Search Postgresql Archives

Re: close inactive client connection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 25, 2009 at 6:26 AM, Luiz Bernardi <lb@xxxxxxxxxxxxxxxxxx> wrote:
> Hello,
>
> I am developing a system, using the ZeosLib, which maintains a permanent
> connection to the database.
>
> When the client loses the connection, the server does not recognize this and
> keeps the connection as if it were active. When the client attempts to
> reconnect, the server creates a new connection and the previous remains
> active.

Eventually the server's network stack will check to see if the
connection is alive or not by sending a tcp keepalive ping.  If it
receives no answers after x number of tries, it will close the socket
and the pg backend will be terminated.

To adjust this time, look at the tcp keepalive parameters in either
the postgresql.conf file or system wide on your server.  The default
timeout is 2 hours.  It's not unusual to drop it to 5 or 10 minutes on
busy systems.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux