Skip site navigation (1) Skip section navigation (2)

Re: Apache + PHP + Postgres Interaction

From: Hannes Dorbath <light(at)theendofthetunnel(dot)de>
To: Bill Moran <wmoran(at)potentialtech(dot)com>
Subject: Re: Apache + PHP + Postgres Interaction
Date: 2007-08-24 12:50:57
Message-ID: 46CED431.1000503@theendofthetunnel.de (view raw or flat)
Thread:
Lists: pgsql-general
On 24.08.2007 12:56, Bill Moran wrote:
>> How did you verify that? It will spawn a new connection silently, if the 
>> old got dropped. Did you really verify your logs, that you don't get 
>> more new connections than Apache spawns workers? This might not be 
>> noticeable for you, if you are running Apache. In a FCGI environment 
>> where you have a fixed amount of workers, you notice new connections, as 
>> there should not be any.
> 
> As I stated in the other reply to an email that looked similar to this
> one -- I'm not sure I understand the behaviour you're trying to describe.

Persistent connections get randomly dropped. Now there is either an 
Apache worker with mod_php or and FCGI child that has lost its 
connection to the database. On the next request that is processed by 
this child / worker it will notice that it has lost its connection and 
will create a new one. This behaviour might depend on 
pgsql.auto_reset_persistent.

When using a classical Apache config (that is a non-threaded MPM) Apache 
does adjust its number of workers dynamically, so it's natural that more 
database connections are created under load and are dropped again after 
some idle time. That is why it might be hard to verify that you are not 
hit by this bug, as in your environment there is a native fluctuation.

In an FCGI environment however, you will notice this immediatelly, as 
the number of childs / workers is usually fixed and something must be 
broken if connection come and go.


-- 
Regards,
Hannes Dorbath

In response to

pgsql-general by date

Next:From: AndrusDate: 2007-08-24 12:56:12
Subject: Re: reporting tools
Previous:From: Trevor TalbotDate: 2007-08-24 12:49:43
Subject: Re: FATAL: could not reattach to shared memory (Win32)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group