Re: keep alive losing connections

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: johnf <jfabiani(at)yolo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: keep alive losing connections
Date: 2008-09-11 16:13:14
Message-ID: dcc563d10809110913t13d65a59sd8a81800dc86bfec@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Sep 11, 2008 at 10:07 AM, johnf <jfabiani(at)yolo(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Lindstrom 2008-09-11 16:13:46 Windows ODBC Driver
Previous Message Marcus Engene 2008-09-11 16:08:15 index on id and created_at