Friends of the company's products running on the Windows+nginx+tomcat platform, found that a little connection, access to a problem. A large amount of time_wait is also found when viewed through Netstat on the host. On the Linux platform this problem is very good to solve, through the sysctl.conf to adjust the TCP/IP parameters. Windows is confirmed to have similar regulatory mechanisms, called Dynamicportrange.
First, under the windows7/win2008 platform
1, view the number of available ports
Here are the results I looked at under Win7
c:\users\thinkpad>netsh int IPv4 show Dynamicportrange TCP
Protocol TCP dynamic port range
---------------------------------
Boot port: 1025
Number of ports: 13976
Win2008 under the 49152 through 65535, the number of available ports 16,384.
2. Netsh commands modify the number of available ports
netsh int ipv4 set dynamicport tcp start=2000 num=63000
netsh int ipv4 set dynamicport UDP start=2000 num=63000
netsh int ipv6 set dynamicport tcp start=2000 num=63000
netsh int ipv6 set dynamicport UDP start=2000 num=63000
3, time_wait timeout time adjustment
Regedit open the registry and add
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
"MaxUserPort" =dword:0000fffe
"Tcptimewaitdelay" =dword:0000005 (shortened to 5 seconds)
Reference page, Microsoft support page.
Second, Windows xp/win2003
Here are the information found on some Web sites:
Based on a number of sites only prompted the Win2003 available port range, but did not give how to adjust the Win2003 host port adjustment method. Here also through the Microsoft Official Technology station, found the modification method.
1, modify the available port range
Open registry-Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters-Edit new DWORD Value, add MaxUserPort
Value Data:enter A decimal value between 5000 and 65534 here
It is important to note that when the modifications are completed, the host is required to reboot.
2. Modify Time_wait Value
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
On the Edit menu, click New, DWORD Value
Value Name:tcptimedwaitdelay
Value data: <enter A decimal value between Here>
The default value is 240 seconds (the available range is 30-300), after modification to 30 seconds, reboot the system to make the changes take effect