From: Andrew Chernow on 28 Jun 2010 15:13 >> >> It seems faily simple to yank these values out, no? Even easier if you use >> the all-in-wonder shell function SHGetValue(). > > We don't want to use that function, because it brings in a bunch of > extra dependencies. This makes libpq.dll more heavyweight and more > importantly, decreases the number of parallell connections we can deal > with on the server side (on win32 at least, not sure about win64). > Oh, didn't know that. Are the standard reg functions, open/query/close really that bad? Can't be any worse than the security api or MAPI hell ;) -- Andrew Chernow eSilo, LLC every bit counts http://www.esilo.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: Andrew Chernow on 28 Jun 2010 15:03 > > The way I see it, we have two options: > 1) Read the default value from the registry. That's some fairly ugly code, imho. It seems faily simple to yank these values out, no? Even easier if you use the all-in-wonder shell function SHGetValue(). HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters Values: KeepAliveTime, KeepAliveInterval Type: DWORD The only annoying thing is that the values may not exist. Well, it is also rather annoying there is no way to set the counter. > > The API used is documented at: > http://msdn.microsoft.com/en-us/library/dd877220(v=VS.85).aspx > Patch as it looks now (libpq only, and with obvious problems with this > issue): http://github.com/mhagander/postgres/compare/master...win32keepalive > and here :) http://archives.postgresql.org/pgsql-hackers/2009-05/msg01099.php -- Andrew Chernow eSilo, LLC every bit counts http://www.esilo.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: Magnus Hagander on 28 Jun 2010 16:21 On Mon, Jun 28, 2010 at 21:10, Magnus Hagander <magnus(a)hagander.net> wrote: > On Mon, Jun 28, 2010 at 21:03, Tom Lane <tgl(a)sss.pgh.pa.us> wrote: >> Magnus Hagander <magnus(a)hagander.net> writes: >>> On Mon, Jun 28, 2010 at 20:45, Tom Lane <tgl(a)sss.pgh.pa.us> wrote: >>>> I vote for #2. It's the least inconsistent --- we don't pay attention >>>> to the registry for much of anything else, do we? >> >>> Directly, no? Indirectly, we do. For every other TCP parameter >>> (because the registry controls what we'll get as the default when we >>> "just use things") >> >> Not if we make the code use the RFC values as the defaults. I'm >> envisioning the GUC assign hooks doing something like >> >> #ifdef WIN32 >> if (newval == 0) >> newval = RFC-specified-default; >> #endif > > Right. (I've only looked at the libpq side so far) > > Also, we could avoid caling it *at all* if neither one of those > parameters is set. That'll take a bit more code (using the > unix-codepath of setsockopt() to enable keepalives at all), but it > shouldn't amount to many lines.. Here's what I'm thinking, for the libpq side. Similar change on the server side. Seems ok? (still http://github.com/mhagander/postgres/compare/master...win32keepalive for those that prefer that interface) -- Magnus Hagander Me: http://www.hagander.net/ Work: http://www.redpill-linpro.com/
From: Tom Lane on 28 Jun 2010 16:39 Magnus Hagander <magnus(a)hagander.net> writes: > Here's what I'm thinking, for the libpq side. Similar change on the > server side. Seems ok? I had in mind just legislating that the defaults are the RFC values, none of this "try to use the registry values in one case" business. I don't believe that you can make the server side act that way without much more ugliness than is warranted. Also, at least on the libpq side there is no backwards compatibility argument to be made, because we never turned on keepalives at all on that side in previous releases. 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: Magnus Hagander on 28 Jun 2010 16:41
On Mon, Jun 28, 2010 at 22:39, Tom Lane <tgl(a)sss.pgh.pa.us> wrote: > Magnus Hagander <magnus(a)hagander.net> writes: >> Here's what I'm thinking, for the libpq side. Similar change on the >> server side. Seems ok? > > I had in mind just legislating that the defaults are the RFC values, > none of this "try to use the registry values in one case" business. Um, if you look at that patch, it doesn't try to use the registry. It falls back directly to the system default, ignoring the registry. The only special case is where the user doesn't specify any of the parameters. > I don't believe that you can make the server side act that way without > much more ugliness than is warranted. �Also, at least on the libpq side > there is no backwards compatibility argument to be made, because we > never turned on keepalives at all on that side in previous releases. -- 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 |