A large amount of time_wait processing in Linux

Source: Internet
Author: User

Linux: RedHat as4

After the socket program closes the connection, the port is not released immediately. The default time is 60 seconds later.

Run the netstat-An command to check whether a large number of time_wait instances exist.

If the connection frequency is high, the port will be exhausted.

Solution:

# Vi/etc/sysctl. conf
Add the following content:
Net. ipv4.tcp _ tw_reuse = 1
Net. ipv4.tcp _ tw_recycle = 1
Net. ipv4.tcp _ syncookies = 1
Save and exit.
# Sysctl-P

Description

Net. ipv4.tcp _ syncookies = 1 enable the time-Wait socket reuse function, which is very effective for Web servers with a large number of connections.
Net. ipv4.tcp _ tw_recyle = 1
Net. ipv4.tcp _ tw_reuse = 1 reduce the time in the fin-wait-2 connection state, so that the system can process more connections.

Address: http://blog.csdn.net/Avoid/article/details/1908038

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.