Re: keep alive losing connections - Mailing list pgsql-general

From Scott Marlowe
Subject Re: keep alive losing connections
Date
Msg-id dcc563d10809110913t13d65a59sd8a81800dc86bfec@mail.gmail.com
Whole thread Raw
In response to keep alive losing connections  (johnf <jfabiani@yolo.com>)
Responses Re: keep alive losing connections
List pgsql-general
On Thu, Sep 11, 2008 at 10:07 AM, johnf <jfabiani@yolo.com> wrote:
> Hi,
> I have read several of the posting on the list and I'm guessing I have a
> router issue because I get disconnected from the database after some idle
> time.  I'm connecting remotely to a postgres 8.3.1 on openSUSE 11.  My
> question is how can I determine what the real cause of dropping the
> connection.  Is it my router or the firewall on the remote server, or
> something else?

Hard to say really without running some kind of network analyzer like
wireshark (I think that's the new name) on both ends and watching for
RST packets.

But, you can usually overcome this problem by setting a lower
tcp_keepalivetime, something like 900 (15 minutes) or 300 (5 minutes)
will usually do the trick, and has the added bonus of harvesting
connections left behind by processes that didn't properly disconnect
(crashed, lost network connection) more often than once every 2 hours.

pgsql-general by date:

Previous
From: johnf
Date:
Subject: keep alive losing connections
Next
From: "Greg Lindstrom"
Date:
Subject: Windows ODBC Driver