Mine the Harvest

Netstat connection timers

by on Apr.29, 2013, under Linux

Netstat is so dang useful.  I never knew it had the ability to report connection timers. Netstat, I love you.




How long have those connection been there anyway?

[root@gibson ~]# netstat -tonp
tcp 0 0 ::ffff: ::ffff: TIME_WAIT - timewait (0.00/0/0)
tcp 0 0 ::ffff: ::ffff: TIME_WAIT - timewait (43.72/0/0)

Or hows that keepalive going?

[root@gibson ~]# netstat -tonp | grep ESTABLISHED | grep keepalive
tcp 0 0 ESTABLISHED 13694/postgres keepalive (5846.25/0/0)
tcp 0 0 ESTABLISHED 4132/pgagent keepalive (5116.28/0/0)

Yeah, but what about how long they have been in CLOSE_WAIT?

[root@gibson ~]# netstat -tonp | grep CLOSE_WAIT
tcp 1 0 CLOSE_WAIT 29817/httpd off (0.00/0/0)
tcp 1 0 CLOSE_WAIT 25264/httpd off (0.00/0/0)

Ahhh . . . there is no time out value for CLOSE_WAIT. Darn.

Your current timeout and keepalive settings in seconds:
cat /proc/sys/net/ipv4/tcp_fin_timeout
cat /proc/sys/net/ipv4/tcp_keepalive_time

No comments for this entry yet...

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

RSS RSS My Ramblings

Visit our friends!

A few highly recommended friends...