0

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?

tsds
  • 105
  • 1
  • 6

1 Answers1

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 ?

adaptr
  • 16,576
  • 23
  • 34
  • 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 02 '12 at 09: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 02 '12 at 09:36
  • ....WHY do you think you NEED to LOWER them? – adaptr Mar 02 '12 at 09:40
  • because these connections uses my server resources although they are actually doing nothing – tsds Mar 02 '12 at 09: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 02 '12 at 10:44