Re: Remote connection timed out - Mailing list pgsql-general

From Steve Crawford
Subject Re: Remote connection timed out
Date
Msg-id 4ACE3199.6010801@pinpointresearch.com
Whole thread Raw
In response to Remote connection timed out  (Barbara Stephenson <barbara@turbocorp.com>)
List 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


pgsql-general by date:

Previous
From: David Jantzen
Date:
Subject: Broken WAL recovery, resetting to base timeline
Next
From: Andreas Kalsch
Date:
Subject: Re: Renaming constraints