Click here to Skip to main content
15,885,827 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We use the TCP short connection to connect to server. When the web view is too high, many TIME_WAIT tcp connections cause system can not establish new connection.

I searched some information in Web, and I found many people recommended to set tcp_tw_recycle to 1.

The Linux official document explains this option as follows:
tcp_tw_recycle - BOOLEAN
Enable fast recycling TIME-WAIT sockets. Default value is 0.
It should not be changed without advice/request of technical
experts.

This explanation is not specific. I have the following two questions:
1) How fast? 1 min, 1 sec or others?
2) what does the warning "It should not be changed without advice/request of technical
experts." imply ?
Posted
Updated 23-Oct-12 22:30pm
v2

There seems very little documentation or user experiences of this value but the bottom line seems to be:

  1. No idea; look at the Linux source code.
  2. Don't do it.

The warning against use suggests that it may have other side effects but no one seems to know what they may be.
 
Share this answer
 
Comments
[no name] 24-Oct-12 4:56am    
Thanks for your comment though it is not the final solution :)
Richard MacCutchan 24-Oct-12 5:06am    
Looking at the Google search finds I get the feeling there is not a full or useful answer around.
[no name] 24-Oct-12 5:15am    
me too :)
markkuk 24-Oct-12 7:41am    
The "side effects" involve load balancers, stateful firewalls or other network devices that track TCP connection states. They may get confused and drop packets if sockets get reused too early.
Richard MacCutchan 24-Oct-12 7:58am    
So I think the advice "It should not be changed without advice/request of technical experts." should just read "It should not be changed".
Try tcp_tw_reuse=1 instead, it's generally considered safer. See here[^] for more details.
 
Share this answer
 
Comments
[no name] 24-Oct-12 21:55pm    
Thanks. tcp_tw_reuse may be better choice.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900