Ok, i think we are talking two different things here:
tcp_keepidle is the time (in .5 sec units) an idle TCP connection will be held open instead of closing it. This value is set via the no command or in /etc/tunables (no -p will do exactly this, as zaxxon rightly assumed).
SO_KEEPALIVE does the following: every IP host is required (RFC 1122, Requirements for IP hosts) to be able to send/receive-and-answer certain ACK packets. The time interval of these packets to be sent over an open connection is set with this option in the setsockopt() system call (see
pSeries and AIX Information Center ). This interval is set for every new socket to be created.
Therefore it must be set by the application, not the OS.
There is another tuning parameter
tcp_keepintvl which seems to do the same as SO_KEEPALIVE. The documentation does not explicitly state it but i suppose this is the system default if SO_KEEPALIVE is not set individually upon opening the socket. The default for this value is 150 (^=75 sec).
But SO_KEEPALIVE and tcp_keepintvl are both not dealing with
idle but with
broken connections. A connection which is valid but idle will not be closed until the time stated in tcp_keepalive has passed. During this time the connection will be checked periodically (in SO_KEEPALIVE intervals) it it still would work.
Searching for examples i found that setting SO_KEEPALIVE is configurable value in Websphere MQ, so this supports my assumption that it is an application parameter, not an OS parameter.
See here:
Help -
I hope this helps.
bakunin