Got it

How Do I Reduce the Time for Canceling TCP Connections in TIME_WAIT State on Win

Latest reply: Mar 28, 2016 15:41:30 1208 1 0 0 0

Hello everyone,

Today I will share with you how to reduce the time for canceling TCP connections in TIME_WAIT state on Windows.


In a large-scale Windows environment, a large number of Transmission Control Protocol (TCP) connections in the TIME_WAIT state exist after Nginx reverse proxy service is adopted. By default, TCP connections in the TIME_WAIT state is canceled in 4 minutes. By default, the dynamical TCP ports ranges from 49152 to 65535. As a result, TCP connections are recycled slowly, which leads to a throughput decrease or access failures (error code: 502). You can modify operating system (OS) kernel parameters to shorten the recycling duration for TCP connections in the TIME_WAIT state and enlarge the dynamical TCP port range. This ensures that OS port resources are available when a large number of clients access the server concurrently.


That is all I want to share with you!

1. Log in to the Windows OS as theAdministrator user.
2. Change the recycling duration for TCP connections.
a. On Windows, choose Start > Run.
b. In the Run dialog box, enter regedit and press Enter to open the registry editor.
c. In the Registry Editor, open HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters.
d. Choose Edit > New > DWORD (32-bit) Value and enter TcpTimedWaitDelay.
e. Right-click TcpTimedWaitDelay and choose Modify from the shortcut menu.
f. In the Base area of the Edit DWORD (32-bit) Value dialog box, set the decimal number to 30 and click OK.
g. Exit the registry editor.
3. Modify the port range.
a. On Windows, choose Start > Run.
b. Enter cmd and press Enter to open the command-line interface.
c. Run the following command to modify the port range:
netsh int ipv4 set dynamicportrange tcp startport=5000 numberofports=60000
4. Restart the OS.


View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.