Re: PGconn gets frozen ocassionally after select() timeout - Mailing list pgsql-general

From Tom Lane
Subject Re: PGconn gets frozen ocassionally after select() timeout
Date
Msg-id 4026.1258130344@sss.pgh.pa.us
Whole thread Raw
In response to PGconn gets frozen ocassionally after select() timeout  (Marek Peca <marek@duch.cz>)
Responses Re: PGconn gets frozen ocassionally after select() timeout  (Marek Peca <marek@duch.cz>)
List pgsql-general
Marek Peca <marek@duch.cz> writes:
> The problem: most of time, everything works fine, hundreds of successful
> or even timed-out selects() get handled without any problem. But time to
> time (eg. after several hours), the select() call returns with a timeout
> and then, a request to the opened PQconn (simple query) gets stuck, the
> call hangs and never returns.

What that sounds like is a network-level problem.  In particular, if
there's a NAT-capable router between your client and server machines,
it's probably dropping the connection after a certain period of
inactivity.  You may be able to fix this within Postgres by adjusting
the server's tcp_keepalives_idle setting.  If the server is on a
platform that doesn't support changing the keepalive interval, the
only recourse is to fix the router.

            regards, tom lane

pgsql-general by date:

Previous
From: Thom Brown
Date:
Subject: Re: [pgeu-general] pgday.eu
Next
From: Andrew Chernow
Date:
Subject: Re: Libpq binary mode SELECT ... WHERE ID IN ($1) Question