Skip site navigation (1) Skip section navigation (2)

Re: keepalives on MacOS X

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: keepalives on MacOS X
Date: 2010-06-29 04:42:22
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> It looks like the recent keepalives patch won't support MacOS X,
> because MacOS X does not have the TCP_KEEPIDLE, TCP_KEEPINTVL, and
> TCP_KEEPCNT socket parameters.  It does have this:

It looks to me like there's support for setting KEEPIDLE and KEEPINTVL
via sysctl, but of course that's system-wide and presumably requires
root privilege to set.  (Apple seems to have inherited that from various
BSDen, btw; it's not unique to Darwin.)

> #define TCP_KEEPALIVE           0x10    /* idle time used when
> SO_KEEPALIVE is enabled */

> Should we try to support that as a synonym for TCP_KEEPIDLE, if that's
> what it is?  Or not worry about it?  Or... what?

Yeah, a bit of rooting around in the Darwin sources shows that this
value is used as a per-connection override for tcp_keepidle.  So it
is a synonym.  Not sure if it's worth supporting when the other value
can't be set too.  Maybe it'd be more useful to document that people can
set the system-wide values if they're desperate.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Fujii MasaoDate: 2010-06-29 05:22:44
Subject: Re: suppress automatic recovery after back crash
Previous:From: Fujii MasaoDate: 2010-06-29 03:48:08
Subject: Re: keepalives on MacOS X

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group