More Deep Discovery on your Linux Server With /proc
Jan 19, 2011, 18:34 (0 Talkback[s])
(Other stories by Juliet Kemp)
How to Help Your Business Become an AI Early Adopter
"Linux's amazing and powerful pseudo-filesytem proc isn't just
for peering into a running kernel. Juliet Kemp shows how Linux
admins can also change kernel parameters on the fly.
"Last month I looked at some of the interesting data you can get
out of /proc/. But /proc isn't just for getting information out of
the system and into convenient text form. You can also use it to
put information into the system, and thereby change it. The sys/
directory, which is where kernel variable information is kept, is
where most of the things you might want to alter live. Changes made
here will take effect immediately; no need to reboot. A real boon
for working sysadmins! Note that you'll need appropriate (root)
privileges to change these values. See here for a discussion of
using sudo with pipes.
"/proc/sys/net/ipv4/ contains a bunch of networking values to
try playing around with.
"/proc/sys/net/ipv4/tcp_keepalive_time sets how long (in
seconds) it takes the TCP keepalive routines to send the first
keepalive probe. A keepalive message simply detects whether the
other side of the connection is still there; if not, it drops the
connection. However, the default is 7200 seconds (2 hours), which
is probably after your session would have timed out itself. If you
want something quicker than that, you can change this value to send
a keepalive sooner (and thus drop the session sooner if the other
side has gone away). Setting it to 120 seconds would start sending
keepalives after two minutes."