Received: from localhost (pluto.hub.org [200.46.204.4]) by postgresql.org (Postfix) with ESMTP id 3FD1C9F9EEF for ; Fri, 17 Nov 2006 07:18:17 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.4]) (amavisd-new, port 10024) with ESMTP id 72162-05 for ; Fri, 17 Nov 2006 07:18:10 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id D1EF99F98F8 for ; Fri, 17 Nov 2006 07:18:11 -0400 (AST) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id B6B6E7633F; Fri, 17 Nov 2006 11:18:09 +0000 (GMT) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 6A1BA15EAB; Fri, 17 Nov 2006 11:18:09 +0000 (GMT) Message-ID: <455D9B14.7030407@archonet.com> Date: Fri, 17 Nov 2006 11:20:52 +0000 From: Richard Huxton User-Agent: Thunderbird 1.5.0.7 (X11/20060918) MIME-Version: 1.0 To: Jean-Max Reymond Cc: pgsql-performance@postgresql.org Subject: Re: Keeping processes open for re-use References: <5.1.0.14.0.20061109123348.0418fbb8@mailserver.dmr.co.uk> <1163076964.2839.1.camel@coppola.muc.ecircle.de> <4553DF77.7030000@007Marketing.com> <1163125151.28784.154.camel@localhost.localdomain> <4b09a0c0611160939h13be7da1n5a21def5f27fdae7@mail.gmail.com> In-Reply-To: <4b09a0c0611160939h13be7da1n5a21def5f27fdae7@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/133 X-Sequence-Number: 21903 Jean-Max Reymond wrote: > 2006/11/10, Joshua D. Drake : >> >> I would actually suggest pg_pool over pg_pconnect. >> > > Please, can you explain advantages of pg_pool over pg_connect ? He said pg_pconnect (note the extra "p"). This provides permanent connections to the database from PHP. However, you will end up with one connection per Apache process running (without running multiple Apache setups to serve different content types). Since many processes will be serving images or static content you have a lot of wasted, idle, connections. Now, pg_pool allows you to maintain a small number of active connections (say 20 or 50) and have PHP connect to your pgpool server. It allocates the next free connection it holds and so lets you minimise the number of connections to PostgreSQL. HTH -- Richard Huxton Archonet Ltd