Tuning Windows Parameters

For Windows platforms, the default TCP/IP settings are usually sufficient. However, under heavy loads it may be necessary to adjust the MaxUserPort and TcpTimedWaitDelay. These parameters determine the availability of user ports requested by an application.

Parameter Default Value Suggested Value
TcpTimedWaitDelay

This parameter controls the amount of time the OS waits to reclaim a port after an application closes a TCP connection. It has a default value of 4 minutes. During a heavy users load, these limits may be exceeded resulting in an address- in-use connection exception.

Set this parameter in the Windows registry at the following location: HKLM\System\CurrentControlSet\Services\Tcpip\Parameters

Value Name: TcpTimedWaitDelay

Value Type: DWORD

Data: 30 (decimal)

240 30

MaxUserPort

Value Name: MaxUserPort

Value Type: DWORD

Data: 65534 (decimal)

Beginning with Windows2008 it is necessary to execute the following command in order to set the mentioned number of ports:

netsh int ipv4 set dynamicportrange protocol=tcp startport=10100 numberofports=55433 store=persistent

The given command is based on the following articles at support.microsoft.com:

Dynamic Port Range

Windows Settings

5000 65534