Linux time_wait reduction method-Linux Enterprise Application-Linux server application information. The following is a detailed description. Check the number of Apache connections and sometimes find many useless Time_Wait connections. Some people say this is normal because a request is interrupted midway through; others say that Microsoft's IE connection will generate more Time_wait than Firefox connection. I personally think that it is normal to have a certain Time_wait. If the percentage of connections exceeds the limit, it is not normal, so I should find a solution.
Check the current net. ipv4.tcp _ tw value and change the current value to 1 minute:
[Root @ aaa1 ~] # Sysctl-a | grep net. ipv4.tcp _ tw
Net. ipv4.tcp _ tw_reuse = 0
Net. ipv4.tcp _ tw_recycle = 0
[Root @ aaa1 ~] #
Vi/etc/sysctl
Set these two parameters: reuse indicates whether to allow re-application of a socket in the TIME-WAIT status to be used for a New TCP connection; recyse indicates accelerating TIME-WAIT sockets collection
Use netstat to check again
The key to solving the problem here is how to reuse the value of time_wait. We can check the value of time and wait.
This phenomenon is actually normal. Sometimes it is related to a large amount of traffic. Set the two parameters: reuse indicates whether to allow re-application of the socket in the TIME-WAIT Status for New TCP connections; recyse accelerates TIME-WAIT sockets collection.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service