Received: from ngate.rdw.ru ([195.42.172.254]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eB6CFKt11566 for ; Wed, 6 Dec 2000 07:15:24 -0500 (EST) (envelope-from borz_off@rdw.ru) Received: (qmail 20808 invoked from network); 6 Dec 2000 12:01:24 -0000 Received: from unknown (HELO SPIDER) (192.168.0.212) by ngate1.rdw.ru with SMTP; 6 Dec 2000 12:01:24 -0000 Date: Wed, 6 Dec 2000 15:01:01 +0300 From: Alexey Borzov X-Mailer: The Bat! (v1.47 Halloween Edition) UNREG / CD5BF9353B3B7091 Reply-To: Alexey Borzov Organization: RDW X-Priority: 3 (Normal) Message-ID: <1119521331.20001206150101@rdw.ru> To: =?ISO-8859-1?B?SGVydukgUGllZHZhY2hl?= CC: pgsql-php@postgresql.org Subject: Re: pg_pconnect - Really persistent ? In-reply-To: <3A2E22FC.2E1A2C01@elma.fr> References: <3A2E22FC.2E1A2C01@elma.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200012/7 X-Sequence-Number: 50 Greetings, Hervé! Well, there are some problems, indeed. 1) PHP counts connections on a per-process basis. So, when you have, say, 10 httpd processes, and a limit of 10 connections is set in php.ini, you can have total of 100 postgres backends, with a default limit of 32. 2) PHP does not reuse persistent connections when it can open a new one. So set a limit of pconnections to 1 or 2 in php.ini, and everything will work as intended. At 06.12.2000, 14:43, you wrote: HP> I have some troubles with the pg_pconnect function ... HP> All my PHP scripts are using pg_pconnect but apache seems to not using HP> the persistent connection ... ? HP> I mean that when I make a small script usign a pg_pconnect, and a simple HP> select ... I open 2 browsers and call many time my scrip, I look for the HP> backends of postgresql and I see many backends opened ! HP> If I try for example to limit the backend to 35, and run an ab (apache HP> bench) to call the page ... after the 35 connections opened postgresql HP> say there is no more connection possible ... ok ! but why the HP> persistents connexions are not re-used ? -- Yours, Alexey V. Borzov, Webmaster of RDW