X-Original-To: pgsql-php-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 7BC2F9FB1F8 for ; Tue, 1 Aug 2006 10:45:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 04372-08 for ; Tue, 1 Aug 2006 10:45:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from eastrmmtao06.cox.net (eastrmmtao06.cox.net [68.230.240.33]) by postgresql.org (Postfix) with ESMTP id 4897C9FB1FC for ; Tue, 1 Aug 2006 10:45:08 -0300 (ADT) Received: from [192.168.0.10] (really [68.226.0.201]) by eastrmmtao06.cox.net (InterMail vM.6.01.06.01 201-2131-130-101-20060113) with ESMTP id <20060801134507.USRK16402.eastrmmtao06.cox.net@[192.168.0.10]>; Tue, 1 Aug 2006 09:45:07 -0400 From: Robert Treat To: pgsql-php@postgresql.org, peter.hofer@ics.at Subject: Re: connection pool Date: Tue, 1 Aug 2006 09:45:02 -0400 User-Agent: KMail/1.9.1 References: <008d01c6b4da$5143b5e0$6515a8c0@ics2003.local> In-Reply-To: <008d01c6b4da$5143b5e0$6515a8c0@ics2003.local> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608010945.02939.xzilla@users.sourceforge.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.031 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200608/3 X-Sequence-Number: 3574 On Monday 31 July 2006 15:48, Peter Hofer wrote: > Hallo > > Need your help > > 1 got a Site runnig php 4.4.2 and postgresql (8.1.4) and > Follwing problem > > - 4 Server (Apache) up to 300 clients connection to the DB > - 1 DB machine > > So: > > - If I run with persisent, i got up to 1200 Connction and I run out > of memeory > one recommendation would be to set your max # of apache children to something less than the amount of connections you can handle on postgresql. for example, if you can only handle 1000 connections, set the max # of children per server to say 245 (leave 20 slots for super user connections). one thing I do wonder about is just how much ram (or how little) you have available. istm 1200 connections should not run you out of memory on a dedicated db machine. > - if I run with no persisent connection i got massive forking of postgres > (but less problems) > yeah... I often recommend not using persistent connections in php since they tend to cause trouble :-) > How can I build up a Pool of Connections ? > > What about "Pgpool" ? > RIght... pgpool basically acts as an intermediary, so everything connects to the pool, which then forwards on requests to the database. I would think reducing the number of apache children would work better, but this might be worth a shot since your mixing pg_connect and pg_pconnect between servers. If you do please report back your experience to the list :-) -- Robert Treat Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL