X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id EB249D1C914 for ; Mon, 15 Dec 2003 23:18:22 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 34213-06 for ; Mon, 15 Dec 2003 19:18:02 -0400 (AST) Received: from server.yourfacility.com (server.yourfacility.com [207.103.74.10]) by svr1.postgresql.org (Postfix) with SMTP id B5A95D1D20B for ; Mon, 15 Dec 2003 19:17:52 -0400 (AST) Received: (qmail 74331 invoked by uid 0); 15 Dec 2003 23:17:56 -0000 Received: from unknown (HELO ROD) (141.149.246.2) by server.yourfacility.com with SMTP; 15 Dec 2003 23:17:56 -0000 From: "Rod K" To: "Sylvain Ross" , "scott.marlowe" Cc: Subject: Re: What is wrong with pg_pconnect() ? Date: Mon, 15 Dec 2003 18:17:45 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/40 X-Sequence-Number: 2486 > -----Original Message----- > From: pgsql-php-owner@postgresql.org > [mailto:pgsql-php-owner@postgresql.org]On Behalf Of Sylvain Ross > Sent: Monday, December 15, 2003 5:54 PM > To: scott.marlowe > Cc: pgsql-php@postgresql.org > Subject: Re: [PHP] What is wrong with pg_pconnect() ? > > > Oh, sorry pal, I were convinced that the child process were > destroyed after > the keepalived connection has died. > > In fact what happens with apache is (if I have understand correctly) : > > - The apache child process (pid 8888) is created with "Client A" connected > on it. > > - if "Client A" don't query the server for 15 secondes (keepalive > timeout), > "Client A" is disconnected from the apache child process, pid > 8888. BUT the > apache child process 8888 is still alive waiting for connections ? Yes > > - If "client A" had launched a script using a pconnect() call, a > connection > has been created beetween a pgsql process and process 8888. Yes > > - a new client "Client B" now connects itself to apache process 8888 (why > this process and not another living idling apache process ? :)), That's controlled by the root apache process. It may or may not be a different process. > I guess any > similar pconnect will use the already existing pgsql connection. Only in the same apache child. > > > I wish I'm right ! > > Thx in advance. > > Sylvain. > > -----Message d'origine----- > De : pgsql-php-owner@postgresql.org > [mailto:pgsql-php-owner@postgresql.org]De la part de scott.marlowe > Envoye : lundi 15 decembre 2003 22:55 > A : Sylvain Ross > Cc : pgsql-php@postgresql.org > Objet : Re: [PHP] What is wrong with pg_pconnect() ? > > > > As Rod pointed out, you likely aren't having dead apache children, just > too many. > > IF you must have pconnects in your code, then you need to configure your > apache server and postgresql server so that the postgresql server can > spawn more children than the apache server. > > Set MaxClients in httpd.conf to something MUCH lower than the default > of 150. Usually 20 to 50 will be plenty. Restart apache. > > Then, set postgresql to handle at least 2x as many backends as with the > max_connections setting and restart it. > > Now, you should be able to handle pconnects. > > My personal testing has shown my dual PIII-750 (being retired at the end > of the month) can handle about 1,000 to 10,000 pg_connects a second, and > about 100,000 to 1,000,000 pg_pconnects a second. Since the average page > build / delivery time on our intranet server is around 0.5 to 1.5 seconds, > the speed of connections is pretty much noise. We have templating, > database accesses, and httpd authentication via LDAP on each page, and the > biggest eater of CPU time is the httpd->LDAP authentication, followed by > the templating, followed by the database layer. I.e. Postgresql and its > connections are the least of our worries. :-0 > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > >