per-socket keep-alive options for TCP
Bruce M. Simpson
bms at FreeBSD.org
Fri Nov 30 04:52:24 PST 2007
Andrew Alcheyev wrote:
> I have recently examined the keep-alive mechanism in FreeBSD's TCP
> stack and found out that it has no tunable variables for keep-alive on
> a per-socket basis.
> Is anyone interested in a patch like this one?
> Alternatively, a patch for FreeBSD may introduce a new kernel option.
> I would appreciate any suggestions.
Seems reasonable. This thread talks about the Solaris implementation and
the general background to keep-alives:
And this thread mentions its use in PostgreSQL:
I'm a bit wary of importing new features into a sensitive and heavily
used module like TCP without regression tests, though, and it should
probably default to the current sysctl defaults in use (default to
keepalives on for each new tcp socket) for traversing stateful firewalls
on the path.
However in this case we are merely introducing new knobs for fine-tuning
the keep-alive behaviour, so no big worry here.
Being able to tune on a per-socket basis is *somewhat* useful, however
what would be useful in the bigger picture is the ability to tune TCP
behaviour based on path selection, where the path currently chosen has
radically different characteristics from the general case (e.g. GPRS,
UMTS, satellite systems).
More information about the freebsd-net