X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 6E4859DC9AC for ; Sat, 28 Jan 2006 12:50:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 06767-04 for ; Sat, 28 Jan 2006 12:50:50 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 242409DC944 for ; Sat, 28 Jan 2006 12:50:50 -0400 (AST) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr4.postgresql.org (Postfix) with ESMTP id EDFD75AF07B for ; Sat, 28 Jan 2006 16:50:49 +0000 (GMT) Received: from root by ciao.gmane.org with local (Exim 4.43) id 1F2tHf-0008IA-BH for pgsql-admin@postgresql.org; Sat, 28 Jan 2006 17:50:43 +0100 Received: from 85.187.136.11 ([85.187.136.11]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 28 Jan 2006 17:50:43 +0100 Received: from milen by 85.187.136.11 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 28 Jan 2006 17:50:43 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-admin@postgresql.org From: "Milen A. Radev" Subject: Re: Postgresql, number of connections and life time Date: Sat, 28 Jan 2006 18:40:03 +0200 Lines: 26 Message-ID: <43DB9E63.3080600@radev.net> References: <43DB2942.3040009@ono.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 85.187.136.11 User-Agent: Mozilla Thunderbird 1.5 (Windows/20051201) In-Reply-To: <43DB2942.3040009@ono.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.253 required=5 tests=[RCVD_NUMERIC_HELO=1.253] X-Spam-Score: 1.253 X-Spam-Level: * X-Archive-Number: 200601/312 X-Sequence-Number: 20400 Juan Miguel writes: [...] > First. > I have a Linux box with postgres 7.4 branche, where web php applications > queries the DB. When Apache launches a php file that connects to the DB, > if I do "ps aux | grep postgrest", I can see a process "postgres user > ...." running, that represents the session openned to the DB. But when > the php program finishes, and closes the connection, this process does > not end. Therefore the number of processes are growing while people > visit the web. ¿ Why ? I see the php code, and there is a closing > command before end. > I see that sometimes I visit a page that connects to the DB and no new > process is performed or remains. I also realise that after several hours > (for example at midnight) those processes don't exist. > What is happening ? Is it usual ? Is there a param to control the number > of process launched and their life times? > In PHP I don't use a pool of connections because, the problem is the > same (there are several processes, and remain after connection closes). [...] May be the PHP application uses persistent connections (http://www.php.net/manual/en/function.pg-pconnect.php)? -- Milen A. Radev