Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running comet server on linux (Debian).
All the connections are proxied by nginx.
And my time_wait/established rate is too big (50k/15k) although I set reuse_connections.
I'd like to reduce this huge amount of unneeded connections in time_wait state.
Here is my sysctl.conf rules:

net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_keepalive_time = 60
net.ipv4.tcp_fin_timeout = 3
net.ipv4.tcp_max_tw_buckets = 360000
net.ipv4.tcp_keepalive_probes=3

Could you give me some clue on how to reduce time_waits?

share|improve this question
    
What is your problem? What do you want to achieve? –  cstamas Mar 2 '12 at 8:44
    
I want to reduce the amount of unneded connections (in time_wait state) –  tsds Mar 2 '12 at 9:15

1 Answer 1

net.ipv4.tcp_max_tw_buckets = 360000

Why is having 50K sockets in TIME_WAIT an issue when you allow for 360K of them ?

share|improve this answer
    
is it ok to set tcp_max_tw_buckets to lower value? if I do so would linux start to reuse my timewaits effectively? –  tsds Mar 2 '12 at 9:31
    
I saw somewhere a suggestion about tcp_max_tw_buckets "you should possibly need to increase this value if you start receiving errors due to this setting" which means that it is not the correct way to lower the number of TIME_WAITs –  tsds Mar 2 '12 at 9:36
    
....WHY do you think you NEED to LOWER them? –  adaptr Mar 2 '12 at 9:40
    
because these connections uses my server resources although they are actually doing nothing –  tsds Mar 2 '12 at 9:51
    
What kind of empirical evidence do you have of this ? Why then is the allowed number of time_wait buckets up to 360K, and if you did not set this value, doesn't it follow that this will be a reasonable default that you have no reason to change ? –  adaptr Mar 2 '12 at 10:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.