Re: Keepalives win32

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Magnus Hagander" <magnus(at)hagander(dot)net>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Pavel Golub" <pavel(at)gf(dot)microolap(dot)com>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Keepalives win32
Date: 2010-06-30 15:29:18
Message-ID: 4C2B1C7E0200002500032D81@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> wrote:

> Windows default for idle is 2 hours, for interval 1 second.

And it defaults to five retries. With these settings, you could
have a TCP connection break with as little as a five second network
outage, if it happened to come after two hours of silence on the
connection; although an outage of up to two hours could go totally
unnoticed. The RFC values have a total of nine tries at 75 second
intervals, so for a single network outage to break a connection, it
would have to last at least ten minutes; but again, an outage of up
to two hours could occur before it started to check for problems.

I'm inclined toward option 2 (previously described on this thread),
because the Windows defaults are dumb. Wait two hours and then test
for five seconds???

I also think we may want to suggest that for most environments,
people may want to change these settings to something more
aggressive, like a 30 to 120 second initial delay, with a 10 or 20
second retry interval. The RFC defaults seem approximately right
for a TCP connection to a colony on the surface of the moon, where
besides the round trip latency of 2.5 seconds they might have to pay
by the byte. In other words, it is *so* conservative that I have
trouble seeing it ever causing a problem compared to not having
keepalive enabled, but it will eventually clean things up. In
practice people usually want something more aggressive.

-Kevin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-06-30 15:31:36 Re: Check constraints on non-immutable keys
Previous Message Tom Lane 2010-06-30 15:21:59 Re: Keepalives win32