Received: from ford.rutgersinsurance.com ([38.138.71.203]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f94D8bn77984 for ; Thu, 4 Oct 2001 09:08:37 -0400 (EDT) (envelope-from aalang@rutgersinsurance.com) Received: (from root@localhost) by ford.rutgersinsurance.com (8.11.2/8.11.2) id f94D1jd04919 for pgsql-php@postgresql.org.KAV; Thu, 4 Oct 2001 09:01:45 -0400 Received: from nj012 ([10.10.10.51]) by ford.rutgersinsurance.com (8.11.2/8.11.2) with SMTP id f94D1iq04911 for ; Thu, 4 Oct 2001 09:01:45 -0400 Message-ID: <009401c14cd4$b5eefa40$330a0a0a@rutgersinsurance.com> From: "Adam Lang" To: References: <20011001213819.82F8B2AB46@bugs.unl.edu.ar> <01a301c14ac2$908990d0$1e51000a@mitch> <20011001225313.C81032AB46@bugs.unl.edu.ar> <01d501c14acc$54b3d520$1e51000a@mitch> <20011002112117.A31207@rakete.joerdens.de> Subject: Re: persistent vs. non-persistent Date: Thu, 4 Oct 2001 09:01:40 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200110/19 X-Sequence-Number: 572 You are correct. It is not max per Apache, but max per child process. Adam Lang Systems Engineer Rutgers Casualty Insurance Company http://www.rutgersinsurance.com ----- Original Message ----- From: "Frank Joerdens" To: Sent: Tuesday, October 02, 2001 5:21 AM Subject: Re: [PHP] persistent vs. non-persistent > On Mon, Oct 01, 2001 at 06:56:37PM -0400, Mitch Vincent wrote: > > I'm not sure about the internal workings, I see what you mean and will await > > your finding with great interest! > > > > -Mitch > > [ . . . ] > > > I don't understand why apache (or PHP) doesn't see that it has a > > persistent > > > database connection open to use. > > > > > > I'm checking the PHP PGSQL extensions at this moment. > > > More info later.... > > > > > > Saludos.... ;-) > > I keep having problems too; I think because I never quite managed to > figure out the mechanism either. Sometime last year someone mentioned > that the php.ini parameters > > pgsql.max_links > pgsql.max_persistent > > are meant to be understood as /per Apache child/; so if you have, say, 5 > Apache children waiting for a request, and > > pgsql.max_persistent = 2 > > you could have up to 10 open connections. If an apache child which does > not have an open connection gets a request, it will open a new > connection, obviously. So if 4 of the 5 Apache children have open > connections, but the 5th gets the next request, a new connection will be > opened. I am not sure about what happens when a child which already has > an open connection gets a new request. Hypothesis: It depends on the > database. Say you have 3 distinct databases on your server and your > php.ini parameter > > pgsql.max_persistent = 2 > > Now let's say you have 10 open Apache children, each of which has a > connection to databases #1 and #2. Now requests to databases #1 and #2 > will be answered, but not to #3: You'll get the error message: > > Warning: PostgreSQL: Too many open persistent links (2) > > My tests seem to confirm this. > > It would seem to follow that you only need as many persistent > connections per Apache child as you have databases from which you want > to serve http requests. > > Regards, Frank > > ---------------------------(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 >