Network Management

Tweaking Windows Server performance to prevent port exhaustion when using SolarWinds Platform modules

The article discusses how to place a band-aid fixture on Windows Systems to avoid the port exhaustion of the TCP/IP stack.

First published date

2/15/2019 2:50 AM

Last published date

8/6/2026 8:34 AM

Overview

The purpose of these changes is to avoid the exhaustion of TCP/IP available ports available to windows by decreasing the time required to dispose of the dead (TIME_WAIT) connections and allow a broader range of ephemeral ports to be used while establishing connections. In most cases, these connections are no longer reusable. A quick turnover makes the system behave much faster—additionally, the article details extending the range of ephemeral (temporary) ports used to establish connections.

Symptoms of this issue can include but are not limited to:

  • Intermittent "Service could not open a connection to the database" errors
  • Multiple DCOM errors across several nodes

 

Microsoft References:

Product section

Orion Platform

Cause

Busy networking applications may reserve too many TCP/IP ports that reach Windows Server OS limitations.
Failed WMI Polling causing excess DCOM errors and filling up available ports.

Resolution

NOTE: SolarWinds strongly recommends that you back up your Windows Registry before making any changes to it. 

You should only edit the Windows Registry if you are experienced and confident in doing so. Misusing a Windows Registry Editor can cause severe issues with your operating system, which could require you to reinstall your operating system to correct them. SolarWinds cannot guarantee resolutions to any damage resulting from making Windows Registry edits.
 

  1. Start Windows Registry Editor (or you could type regedit on the Windows Start Menu)

  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

  3. To create the TcpTimedWaitDelay key:

    NOTE: This key will reduce the length of time that a connection stays in the TIME_WAIT state before the connection is closed. While a connection is in the TIME_WAIT state, the socket pair cannot be reused.
     

    1. Highlight Parameters

    2. Click the Edit menu > New > DWORD (32-bit) Value

    3. Give it a name of TcpTimedWaitDelay (The capitalization matters)

    4. Right-click the new key and select Modify...

    5. Click the decimal radial button

    6. Specify a value between 30 and 240. The lower the value, the quicker the unused connection will be closed. We recommend setting it to 30 seconds. (Windows default is 240 if it is not present in the Registry)
       

      Value NameValue Data
      TcpTimedWaitDelay<Enter a value between 30 and 240>

       

  1. To create the MaxUserPort key:

    NOTE: This key will increase the allowance (expand the range) of TCP Ports that can be allocated on the server.
     

    1. Highlight Parameters

    2. Click the Edit menu > New > DWORD (32-bit) Value

    3. Give it the name of MaxUserPort (The capitalization matters)

    4. Right-click the new key and select Modify...

    5. Click the decimal radial button

    6. Specify a value between 5000 and 65534. The higher the value, the wider the range of available ports. Many users have had success with value 65000 (decimal). (Windows default is 5000 if it is not present in the Registry)
       

      Value NameValue Data
      MaxUserPort<Enter a value between 5000 and 65534>

       

  2. To create the StrictTimeWaitSeqCheck key:

    NOTE: You must set the StrictTimeWaitSeqCheck to 1, or the TcpTimedWaitDelay value will have no effect on the system.
     

    1. Highlight Parameters

    2. Click the Edit menu > New > DWORD (32-bit) Value

    3. Give it the name of StrictTimeWaitSeqCheck  (The capitalization matters)

    4. Right-click the new key and select Modify...

    5. Specify a value 1 (either decimal or hexadecimal). (Windows default is 0 if it is not present in Registry)
       

      Value NameValue Data
      StrictTimeWaitSeqCheck<Enter a value 0 or 1>

       

  3. Close Windows Registry Editor and reboot the server to apply the changes.

 

 

Alternatively, you can use one of the following methods:

Using Windows Registry file (extension REG):

  1. Using any text editor create a file (i.e. tweak.reg)
  2. Paste below content into it
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
    "TcpTimedWaitDelay"=dword:0000001E
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
    "MaxUserPort"=dword:0000FFFE
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
    "StrictTimeWaitSeqCheck"=dword:00000001
  3. Save the file
  4. Double click on the file and allow the import
  5. Reboot the server.

Using a batch file (extension BAT):

  1. Using any text editor create a file (i.e. tweak.bat)
  2. Paste below content into it
    reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v TcpTimedWaitDelay /t REG_DWORD /d 0x0000001E
    reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v MaxUserPort /t REG_DWORD /d 0x0000FFFE
    reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v StrictTimeWaitSeqCheck /t REG_DWORD /d 0x00000001
  3. Save the file
  4. Double click on the file and execute
  5. Reboot the server.