[CentOS] TIME_WAITs...

Fri Feb 27 10:20:16 UTC 2009
John Doe <jdmls at yahoo.com>

Hi,

I was asked to check some TIME_WAITs "problems" (my boss thinks there should almost never be any) and I bumped into something strange...
All of our servers have apparently normal (in my opinion) 60s TIME_WAITs (even if it strangely caps around 14000 in my tests)...
But one of them behaves differently (and my boss thinks it is the normal behavior).
If I make 10000 rapid connections/selects/deconnections to mysql on this server, I get like 1 TW after around 3000, another TW around 6000 and another TW around 9000...  That makes 3 TWs only.  And they last 60 seconds...
I am told this server was not really setup differently (no custom kernel).
All servers are CentOS 5.2, kernels 2.6.18-92.1.[22|10].el5.
I compared the values in sysctl.conf and /proc/sys/net/ipv4/* and nothing different.

So, am I correct in thinking that seeing thousands TWs when there was a burst of thousands connections is normal?
Any idea why so few TWs on this server?  Any conf file I should check?

# cat /proc/sys/net/ipv4/tcp_fin_timeout
60
# cat /proc/sys/net/ipv4/tcp_max_tw_buckets
180000
# cat /proc/sys/net/ipv4/tcp_tw_recycle
0
# cat /proc/sys/net/ipv4/tcp_tw_reuse
0

When I googled for it, many people were pointing to the tcp_fin_timeout value ...  Is it really related to TWs?

Thx,
JD