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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

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.

Hannes Dorbath

In response to

Browse pgsql-general by date

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