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 0BE06D1B462 for ; Mon, 15 Dec 2003 22:13:23 +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 23619-09 for ; Mon, 15 Dec 2003 18:13:02 -0400 (AST) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 09A74D1B430 for ; Mon, 15 Dec 2003 18:12:54 -0400 (AST) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.10/8.12.10) with ESMTP id hBFMBL7N023539; Mon, 15 Dec 2003 15:11:21 -0700 (MST) Date: Mon, 15 Dec 2003 14:54:34 -0700 (MST) From: "scott.marlowe" To: Sylvain Ross Cc: Subject: Re: What is wrong with pg_pconnect() ? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IHS-MailScanner: Found to be clean X-IHS-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/38 X-Sequence-Number: 2484 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