From: Magnus Hagander on
On Wed, Jun 30, 2010 at 16:27, Tom Lane <tgl(a)sss.pgh.pa.us> wrote:
> Magnus Hagander <magnus(a)hagander.net> writes:
>> Do you have an opinion on the two choices for handling keepalives_idle
>> and keepalives_interval? They basically are:
>
>> 1) When not configured, use system defaults. When only one of the two
>> parameters configured, use RFC default for the other one (overwrite
>> system default).
>
>> 2) When not configured, use RFC defaults (overwrite system defaults).
>> When only one of the two parameters configured, use RFC default for
>> the other one (overwrite system default)
>
>> 3) When not configured, use system defaults. When only one of the two
>> parameters configured, throw error.
>
> It's hard to argue about this when most of us have no idea what these
> "system defaults" are, or whether they really are any different from the
> RFC values in the first place, or whether ordinary users know how to
> alter them or even find out their values. �Please provide some
> background if you want intelligent comments.

The system defaults are whatever the user has configured at a machine
level (by editing the registry, by hand or by tool (including
policies)). I doubt many users have configured them by hand. There may
well be tools that do it for them.

Anyway, after some checking i realized #3 can't be implemented anyway
in the backend, since guc won't let us know early enough. So that's
out.

Thus, let's go with #2. Which was your suggestion :)

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Bruce Momjian on
Tom Lane wrote:
> Magnus Hagander <magnus(a)hagander.net> writes:
> > On Wed, Jun 30, 2010 at 16:27, Tom Lane <tgl(a)sss.pgh.pa.us> wrote:
> >> It's hard to argue about this when most of us have no idea what these
> >> "system defaults" are, or whether they really are any different from the
> >> RFC values in the first place, or whether ordinary users know how to
> >> alter them or even find out their values. �Please provide some
> >> background if you want intelligent comments.
>
> > The system defaults are whatever the user has configured at a machine
> > level (by editing the registry, by hand or by tool (including
> > policies)). I doubt many users have configured them by hand. There may
> > well be tools that do it for them.
>
> But you previously stated that this code was ignoring the registry
> values. So doesn't "system defaults" boil down to whatever Windows'
> wired-in defaults are?

For Magnus, #2 was to use the RFC defaults. The OS defaults might be
different for different versions of Windows. We could use the OS
defaults for _some_ version of Windows, but I am not sure that is an
improvement.

I still like #1 because it affects the fewest people, and that option
uses the RFC defaults only for unset values when others are set. I
still think we can do #3 (error), but we have to add a check in an
unrelated place to check for unset values, and the code is likely to be
ugly.

--
Bruce Momjian <bruce(a)momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ None of us is going to be here forever. +

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: "Kevin Grittner" on
Magnus Hagander <magnus(a)hagander.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

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Tom Lane on
Magnus Hagander <magnus(a)hagander.net> writes:
> On Wed, Jun 30, 2010 at 16:27, Tom Lane <tgl(a)sss.pgh.pa.us> wrote:
>> It's hard to argue about this when most of us have no idea what these
>> "system defaults" are, or whether they really are any different from the
>> RFC values in the first place, or whether ordinary users know how to
>> alter them or even find out their values. �Please provide some
>> background if you want intelligent comments.

> The system defaults are whatever the user has configured at a machine
> level (by editing the registry, by hand or by tool (including
> policies)). I doubt many users have configured them by hand. There may
> well be tools that do it for them.

But you previously stated that this code was ignoring the registry
values. So doesn't "system defaults" boil down to whatever Windows'
wired-in defaults are?

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Tom Lane on
Bruce Momjian <bruce(a)momjian.us> writes:
> Tom Lane wrote:
>> What's your idea of "affecting the fewest people"? There is no previous
>> history to be backward-compatible with, because we never supported
>> keepalive on Windows before.

> Well, starting in 9.0, keepalives in libpq will default to 'on':

Yes, which is already a change in behavior. I don't understand why you
are worrying about "backwards compatibility" to parameter values that
weren't in use before. I think self-consistency of the new version is
far more important than that.

> even if we use Windows defaults, those defaults might be different for
> different Windows versions.

I'm not sure if that's an issue or not, but if it is, that seems to me
to argue for #2 not #1.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7
Prev: Propose Beta3 for July
Next: [HACKERS] keepalives on MacOS X