X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2B58FD90C4 for ; Mon, 21 Nov 2005 05:51:53 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 92137-08 for ; Mon, 21 Nov 2005 09:51:54 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from pjetlic.mobart.hr (pjetlic.mobart.hr [80.80.51.10]) by svr1.postgresql.org (Postfix) with ESMTP id 51ABED8C8A for ; Mon, 21 Nov 2005 05:51:50 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by pjetlic.mobart.hr (Postfix) with ESMTP id 3660617A1B; Mon, 21 Nov 2005 10:51:52 +0100 (CET) Received: from pjetlic.mobart.hr ([127.0.0.1]) by localhost (pjetlic [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15055-01-28; Mon, 21 Nov 2005 10:51:52 +0100 (CET) Received: from mike.mobart.hr (mike.mobart.hr [192.168.10.94]) (using SSLv3 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by pjetlic.mobart.hr (Postfix) with ESMTP id 1AD9217A19; Mon, 21 Nov 2005 10:51:52 +0100 (CET) Subject: Re: Accumulating idle processes From: Mario Splivalo Reply-To: mario.splivalo@mobart.hr To: Gary Hoffman Cc: pgsql-admin@postgresql.org In-Reply-To: References: Content-Type: text/plain Organization: Mob-Art Date: Mon, 21 Nov 2005 10:51:52 +0100 Message-Id: <1132566712.8689.21.camel@ekim> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by OpenSource AV+AS Mail Server X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/273 X-Sequence-Number: 19646 On Sun, 2005-11-20 at 22:05 -0800, Gary Hoffman wrote: > I've run PHP and PostgreSQL for quite a while and never seen this problem > before. I think it's new, but maybe I never paid attention to it before. > > I am frequently running out of connections to the database. Here's a > snippet of my ps -ax > > 1882 ?? S 0:00.07 postgres: postgres cgssd_members [local] idle > > 1883 ?? S 0:00.09 postgres: postgres cgssd_members [local] idle > > 1884 ?? S 0:00.07 postgres: postgres cgssd_members [local] idle > > 1886 ?? S 0:00.14 postgres: postgres cgssd_members [local] idle > > 1887 ?? S 0:00.06 postgres: postgres cgssd_members [local] idle > > 500 std- S 0:01.14 /usr/local/bin/postmaster -D > /usr/local/pgsql/data > 501 std- S 0:00.02 postgres: stats buffer process > > 502 std- S 0:00.21 postgres: stats collector process > > > As you can see, there are some connections that have come in from PHP on > my web pages and have gone idle. I've never seen these before and > eventually they build up and I get an error connecting from the PHP page > to the database. I can kill -9 one of them, and the other disappear. What > is going on here? Some cleanup process is not working. > > I'm running Apache 1.3.33 on Darwin Kernal 7.9.0 (MacOS X 10.3.9) with PHP > 4.3.6 and PostgreSQL 7.4.2. > > Ideas and suggestions are welcome. Are you absolutley sure you close postgres connection within your PHP pages? I've experienced very same problem using PHP (i was not using persistent database connections - those seemed much slower) because I was missing several 'pg_close()' instructions. The same thing happened to my developers here, using java/tomcat/jdbc to connect to postgres. Make sure you close all your postgres connections. Mike -- Mario Splivalo Mob-Art mario.splivalo@mobart.hr "I can do it quick, I can do it cheap, I can do it well. Pick any two."