Re: ioctl always returns 0
Re: ioctl always returns 0
- Subject: Re: ioctl always returns 0
- From: Justin Walker <email@hidden>
- Date: Tue, 12 Apr 2005 15:30:39 -0700
On Apr 12, 2005, at 15:17, Vincent Lubet wrote:
On Apr 12, 2005, at 2:38 PM, Justin Walker wrote:
You should set the socket option SO_KEEPALIVE to force the
networking stack to check the peer is responding -- see man page
setsockopt(2). In addition you may want to use the TCP option
TCP_KEEPALIVE to specify the idle time used when SO_KEEPALIVE is
enabled.
Eewww, please don't. Keepalives are an abomination. An active
server with lots of connections is going to generate a fair amount of
useless traffic, and CPU activity. In addition, the kernel timer
mechanism is a scarce resource.
An alternative is to have an activity timer in the server. After a
given time, shut the connection (connections being a scarce
resource...).
TCP keepalive has always been a controversial feature (Stevens even
wrote this a "religious issue" so I'm not surprised by Justin
reaction;-)
Wait a minute...what're you saying? :-}
but it can be very useful in some situations.
The bandwidth used by TCP keepalive is negligible (a gratuitous ACK)
provided the user isn't charged by the amount of data. A lot of higher
level protocols like file transfer protocols use their own keep alive
or tickle mechanism that use more bandwith.
The CPU activity is also very low and is not more than having activity
timer in the server.
On the other it would be an abomination to use a very low idle time.
I'm concerned with the following:
- a server handling lots of connections for a given service
- lots of services
This is a scaling issue, and while "just one won't hurt", a lot of
"just one"'s certainly will. It's a bad idea to design a server that
needs to do this (because it's the "easy answer", that's what every
server designer will choose, unless we discourage it).
Cheers,
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Institute for General Semantics
--------
Men are from Earth.
Women are from Earth.
Deal with it.
--------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden