Re: Hwo to set timeout for PHP persistent connections

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Gabriele Bartolini <g(dot)bartol(at)comune(dot)prato(dot)it>
Cc: PostgreSQL-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Hwo to set timeout for PHP persistent connections
Date: 2003-03-03 18:55:42
Message-ID: Pine.LNX.4.33.0303031155220.12833-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 3 Mar 2003, scott.marlowe wrote:

> On 3 Mar 2003, Gabriele Bartolini wrote:
>
> > Ciao guys,
> >
> > I need to set a reasonable low value of timeout for inactive
> > connections, as they seem to stay up when a PHP script calls a
> > pg_pconnect on the database server.
> >
> > As its main purpose is to serve a Web application, I'd love
> > connections to get close after 10-15 seconds of inactivity.
> >
> > Is there a run-time configuration I can set in Postgres?
>
> As an addendum to my previous post, you can set the max number of requests
> an apache child will process before it is recycled, the setting is called
> MaxRequestsPerChild and if you set it to 0 (the default) then apache
> processes are never killed unless you have more than the max sitting idle.
>
> Setting it something fairly low, like 20 or 50 or 100 means that the
> connections won't last forever, as eventually that child will be killed
> off and it's connection will die.
>
>
> Also, setting StartServers to something low, like 1 will result in more
> processes getting recycled.

Man, I've got serious fat fingers today, that should be spareservers, not
start servers...

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-03-03 18:56:32 versioning and transactions
Previous Message Chris 2003-03-03 18:52:53 LIMIT and SUBQUERIES