Re: Remote connection timed out

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Barbara Stephenson <barbara(at)turbocorp(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Remote connection timed out
Date: 2009-10-08 18:38:17
Message-ID: 4ACE3199.6010801@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Barbara Stephenson wrote:
> Hello,
> We have a website that connects remotely to our 8.3 postgres
> database. I've noticed if I connect to the database and let it sit
> for an hour the connection is lost. Is there a default connection
> timeout?

How "remote"? Through firewalls/VPNs/etc.? My suspicion is that an
intervening portion of the network is dropping the connection. You could
start by analyzing your network. Alternately, the following portion of
postgresql.conf may help you (if these socket options are implemented on
your system).

# - TCP Keepalives -
# see 'man 7 tcp' for details

#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
# 0 selects the system default
#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
# 0 selects the system default
#tcp_keepalives_count = 0 # TCP_KEEPCNT;
# 0 selects the system default

I believe the default for keepalives (at least on my Linux system at the
tcp-level) is to wait 2-hours before sending keepalives. This may be
too long in your case.

Cheers,
Steve

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kalsch 2009-10-08 19:07:10 Re: Renaming constraints
Previous Message David Fetter 2009-10-08 18:37:26 Re: Renaming constraints