Re: Connection pooling

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Max Zorloff" <zorloff(at)gmail(dot)com>
Cc: "Marko Kreen" <markokr(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Connection pooling
Date: 2007-09-08 15:28:52
Message-ID: dcc563d10709080828x473fa4f9v17274d8baa560ac6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/7/07, Max Zorloff <zorloff(at)gmail(dot)com> wrote:
> On Fri, 07 Sep 2007 10:58:36 +0400, Marko Kreen <markokr(at)gmail(dot)com> wrote:
>
> >> The pgpool (I tried 3.1, 3.4 and pgpool-II 1.2) works fine but has the
> >> following problem - after some time it
> >> just "hangs", and if I try to connect to it with psql it just hangs
> >> indefinitely. After restart
> >> it works fine again. I turned off persistent connections in php so it's
> >> not that. Does anybody
> >> have the same problem?
> >
> > All symptoms point to the same problem - your app fails to
> > release server connections for reuse.
> >
> > If the problem is that PHP fails to disconnect connection,
> > although the transaction is finished, you could run pgbouncer
> > in more relaxed mode - pool_mode=transaction. Also setting
> > client_idle_timeout to something may help debugging.
>
> > If the problem is uncommitted transactions, you could set
> > query_timeout to some small number (1-3) to see where
> > errors appear.
> >
> > Both timeouts are not something I would put into productions
> > config, so the code should be fixed still...
>
> pgbouncer does not have this problem, only pgpool does.
> pgbouncer has the problem of being very slow.
>
> i thought php released connections at the end of script?
> and also if i had this problem pgpool would hang in a few seconds
> because the server has some load.

It does if you're running without pg_pconnect (i.e. using regular
pg_connects) and if the script doesn't crash the apache/php backend
it's running in.

Are you using pg_pconnect and / or having crashing apache backends?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message novnov 2007-09-08 17:49:01 Scalability Design Questions
Previous Message Zenaan Harkness 2007-09-08 14:58:34 Re: replacing Access/ Approach etc