[Pgpool-general] Connection dropping unexpectedly

Bruno Lustosa bruno.lists at gmail.com
Fri Aug 29 13:08:29 UTC 2008


Hello, Tatsuo, and thanks for the quick answer.

On Fri, Aug 29, 2008 at 12:14 AM, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
> The strange object comes from an PostgreSQL error message indicating
> the connection to PostgreSQL has been closed. This could happen
> because you are probably using persistent connection in PHP. The
> persistent connection is killed by client_idle_limit. I suggest two
> things:
>
> 1) don't use persistent connection in PHP

I'm not using pconnect in PHP. In fact, I'm using DB_DataObject, and
it manages the connections. It's not using persistent connections. I
guess if it were, I'd be receiving tons of these errors (every apache
process would generate one after the timeout), but instead I'm
receiving just a few per hour.

> 2) check if connection to PostgreSQL (actually pgpoo) is active before
>   using pg_escape_string in your PHP code

pg_escape_string is where things crash in DB_DataObject. It tries to
pass a string, but instead that big object is passed instead, which
leads me to conclude that the error is happening on the query just
before that. Or not?
I could check things there, but I don't know if I can fix it just by
adding another connect call, because the query it would like to run is
already lost. And if this happens inside a transaction, things can go
really bad.
A way to fix this could be to disable the timeout (if this is indeed
caused by the 70s timeout), but I've had problems in the past with
clients not disconnecting and filling up all of pgpool processes.
Do you think any other info could help debug this?

Thanks

-- 
Bruno Lustosa <bruno at lustosa.net>
http://www.lustosa.net/


More information about the Pgpool-general mailing list