Received: from mail.concept-factory.com (mail.concept-factory.com [204.181.16.156]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0SJsPl18666 for ; Mon, 28 Jan 2002 14:54:25 -0500 (EST) (envelope-from mitch@doot.org) Received: from Mitch (cx2156713-a.phnx1.az.home.com [24.38.178.119]) by mail.concept-factory.com (Postfix) with SMTP id 82F8841FBB; Mon, 28 Jan 2002 12:54:23 -0700 (MST) Message-ID: <009a01c1a835$f2d76520$0200000a@Mitch> From: "Mitch Vincent" To: "Chris Ruprecht" , "Frank Bax" Cc: "PostGreSQL PHP Group" References: <3.0.6.32.20020128141957.02130660@pop6.sympatico.ca> Subject: Re: pg_pconnect - ?? Date: Mon, 28 Jan 2002 12:56:59 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Archive-Number: 200201/77 X-Sequence-Number: 881 Very true -- persistent connections are only going to give you a performance gain of the time it takes to start a new PG process. That gain can matter and matter a lot in certain situations but generally only with high-traffic servers. Be careful, it's easy to run out of resources especially if you have your PG processes set to use a good amount of sort/shared memory (and you really should increase it from the default settings to get much better performance) Good luck! -Mitch ----- Original Message ----- From: "Frank Bax" To: "Chris Ruprecht" Cc: "PostGreSQL PHP Group" Sent: Monday, January 28, 2002 12:19 PM Subject: Re: [PHP] pg_pconnect - ?? > The connection will only be reused if the *same* apache child process > handles the request. You should expect to see many postgres client > connections. > A) Each database/user connection combination. > B) Each apache child process > > Multiply A*B to get max number of concurrent connections. If A*B can go > over postgres connection limit, then you might start getting connection > refused messages. > > If your postgres database is on the same server as you webserver, there is > neglible gains for using pconnect over connect. > > Frank > > > At 09:56 AM 1/28/02 -0600, Chris Ruprecht wrote: > >Hi all, > > > >I am under the assumtion that, when I do a pg_pconnect instead of a > >pg_connect, the connection to the db I have established, can be used > >by another PHP procedure. Somehow, I don't see this working the way I > >expect it. > >When I initially connect with pconnect, I see a postgres session > >staring up and everything works. The postgres process stays active > >but when I pconnect again, a second process is started. I was > >expecting that the same process from the first pconnect will be used. > >At the end, I land up with a whole bunch of postgres client sessions > >hanging around in the system, doing who knows what. > > > >What am I missing (doing wrong) here? > >Postgres = 7.1.3, OS = Linux 2.4.9 (RedHat 7.2), PHP = 4.0.6, Apache > >= 1.3.22, memory = plenty (768 MB) > > > >Best regards, > >Chris > >-- > >Chris Ruprecht > >Network grunt and bit pusher extraordinaíre > > > >_________________________________________________________ > >Do You Yahoo!? > >Get your free @yahoo.com address at http://mail.yahoo.com > > > > > >---------------------------(end of broadcast)--------------------------- > >TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > > > > ---------------------------(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 >