timewait status in Netstat

Source: Internet
Author: User

netstat TCP connection under time_wait state:
1. This is a state that is in the state before the connection is completely closed;
2. You usually have to wait 4 minutes (Windows Server) for the time to shut down completely;
3. TCP connections in this state consume resources such as handles and ports, and the server consumes resources to maintain these connection states;
4. Resolving this time_wait TCP connection only allows the server to quickly reclaim and reuse those time_wait resources: Modify the registry [hkey_local_machine\system\currentcontrolset\ Services\Tcpip\Parameters] Add DWORD value tcptimedwaitdelay=30 (30 also recommended for Microsoft; default is 2 minutes) and maxuserport:65534 (optional value 5000-65534);
5. Specific TCPIP connection parameter configuration can also be referenced here: http://technet.microsoft.com/zh-tw/library/cc776295%28v=ws.10%29.aspx
6.linux under:
vi/etc/sysctl.conf
Add the following:
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
Net.ipv4.tcp_syncookies=1
To make the kernel parameters effective:
[email protected] ~]# sysctl-p
Readme:
Net.ipv4.tcp_syncookies=1 opens the time-wait socket reuse feature, 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 reduces the time that is in the Fin-wait-2 connection state, allowing the system to handle more connections.  
net.ipv4.tcp_fin_timeout=30 reduces the time of TCP keepalive connection detection, allowing the system to handle more connections.  
net.ipv4.tcp_keepalive_time=1800 increases the TCP SYN queue length, allowing the system to handle more concurrent connections.  
net.ipv4.tcp_max_syn_backlog=8192

This article is from the "Give Me Three moles" blog, please be sure to keep this source http://wushuangjay.blog.51cto.com/3125450/1652210

timewait status in Netstat

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.