Re: TCP keepalive support for libpq
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Magnus Hagander <magnus@hagander.net>,
Fujii Masao <masao.fujii@gmail.com>, Euler Taveira de Oliveira <euler@timbira.com>, Marko Kreen <markokr@gmail.com>, Tollef Fog Heen <tollef.fog.heen@collabora.co.uk>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2010-06-22T19:28:21Z
Lists: pgsql-hackers
Attachments
- libpq-optional-keepalive.diff (application/octet-stream) patch
On Tue, Jun 22, 2010 at 1:32 PM, Robert Haas <robertmhaas@gmail.com> wrote: > I don't think the burden of proof is on me to demonstrate that there's > a case where this feature isn't available - we're usually quite > reluctant to take advantage of platform-specific features unless we > have strong evidence that they are fully portable across our entire > set of supported platforms. Either I'm doing something wrong, or this doesn't work on Fedora 12. I can adjust the system-wide settings by writing to the /proc filesystem, but setsockopt() blows up (setting keepalives is fine, but changing the subsidiary parameters does not seem to work). [rhaas@f12dev pgsql]$ uname -a Linux f12dev 2.6.32.11-99.fc12.x86_64 #1 SMP Mon Apr 5 19:59:38 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux [rhaas@f12dev pgsql]$ psql -l 'keepalives_idle=30' psql: setsockopt(TCP_KEEPIDLE) failed: Operation not supported [rhaas@f12dev pgsql]$ psql -l 'keepalives_interval=10' psql: setsockopt(TCP_KEEPINTVL) failed: Operation not supported [rhaas@f12dev pgsql]$ psql -l 'keepalives_count=5' psql: setsockopt(TCP_KEEPCNT) failed: Operation not supported WIP patch attached, based on a previous version by Fujii Masao. Note that the same commands work OK on MacOS X 10.6.3. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise Postgres Company