Re: pgAdmin hang on connection drop/reconnect

From: Willy-Bas Loos <willybas(at)gmail(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: Maciek Sakrejda <msakrejda(at)truviso(dot)com>, pgadmin-support(at)postgresql(dot)org
Subject: Re: pgAdmin hang on connection drop/reconnect
Date: 2009-04-23 11:51:07
Message-ID: 1dd6057e0904230451t5a93fe8dq9c56163e77cbab8e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

There are tcp_keepalives on the server side of postgresql
The problem was that debian waits 2 hours before starting the keepalives
(7200 s).
Also, the connection would only be kept alive for 9*75 s, which is 11 min.

So i changed the tcp_keepalives_idle to 120 (keepalives start after 2 min)
and the tcp_keepalives_count to 200 (max 200 keepalives are sent, every 75
secs, so the connection is kept alive for 120+(200*75) secs, which is 4.2
hours.

It seems to have worked.
I'll check if it works on Windows.

==in postgresql.conf==
# - 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

==in man 7 tcp (debian lenny)==
tcp_keepalive_intvl (integer; default: 75)
The number of seconds between TCP keep-alive probes.

tcp_keepalive_probes (integer; default: 9)
The maximum number of TCP keep-alive probes to send before
giving up and killing the connection if no response is obtained from the
other end.

tcp_keepalive_time (integer; default: 7200)
The number of seconds a connection needs to be idle
before TCP begins sending out keep-alive probes. Keep-alives are only sent
when the SO_KEEPALIVE socket
option is enabled. The default value is 7200 seconds (2
hours). An idle connection is terminated after approximately an
additional 11 minutes (9 probes an
interval of 75 seconds apart) when keep-alive is enabled.

Note that underlying connection tracking mechanisms and
application timeouts may be much shorter.

Cheers,

WBL

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Guillaume Lelarge 2009-04-23 12:01:17 Re: system database flag?
Previous Message Tore Halvorsen 2009-04-23 10:54:12 pgAmin 1.10 beta 2 and slony schema