Re: Apache + PHP + Postgres Interaction - Mailing list pgsql-general

From Hannes Dorbath
Subject Re: Apache + PHP + Postgres Interaction
Date
Msg-id 46CED431.1000503@theendofthetunnel.de
Whole thread Raw
In response to Re: Apache + PHP + Postgres Interaction  (Bill Moran <wmoran@potentialtech.com>)
List 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

pgsql-general by date:

Previous
From: "Trevor Talbot"
Date:
Subject: Re: FATAL: could not reattach to shared memory (Win32)
Next
From: Josh Trutwin
Date:
Subject: Re: [OT - sorta] How to extract a substring using Regex