KNOWLEDGE BASE

TCP Dynamic Port Exhaustion


Product(s): Tableau Server
Version(s): All
Last Modified Date: 16 Aug 2016

This article helps you determine if your Tableau Server is experiencing dynamic port exhaustion and guides you through the process of increasing the dynamic port range.

If Tableau Server receives a high number of web requests, you may encounter problems with port exhaustion. Port exhaustion occurs when all the dynamic ports on a server are in use. Dynamic ports, also called ephemeral ports, are a range of ports designated for use with short-lived connections.

Tableau Server is more likely to experience port exhaustion if it is part of a distributed installation or if it integrates with other services—both of which increase the number of requests, and as a result, the number of dynamic ports in use on the server.

Symptoms of port exhaustion

Port exhaustion may be difficult to identify due to the many ways that it can manifest. The following list describes some of the common symptoms of port exhaustion:

  • Connections to the server fail. For example, you may see the following error:

    Unable to connect to the remote server

    System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted.

  • Connections to the server time out.

  • Performance is worse than expected.

  • The server stops responding.

Determine if port exhaustion is the problem

To determine if these symptoms are caused by port exhaustion, you need to determine how many dynamic ports are in use. To do so, first identify the dynamic port range, and then view ports that are currently in use.

Identify the dynamic port range

  1. Open a command prompt as an administrator, and run the following command to determine the dynamic port range:

    netsh int ipv4 show dynamicportrange tcp

    or

    netsh int ipv6 show dynamicportrange tcp

    The command displays the port number of the first dynamic port, also called the start port, and the number of ports.

  2. Add the number of ports to the start port to determine the dynamic port range. For example, if the start port is 60000 and the number of ports is 5000, then the range is from 60000 through 65000.

    On Windows Server 2008 and later, the default range for dynamic ports is from 49152 through 65535.

    For more information about the netsh command, see the Netsh Command Reference on Microsoft TechNet.

View ports currently in use

  1. Run the following command to view the ports that are currently in use:

    netstat –n

    Tip: To send the output of the command to a file, enter the following command:

    netstat –n > out.txt

  2. Compare the ports that are currently in use to the dynamic port range. If most or all of the ports are in use, then it is likely that Tableau Server is experiencing port exhaustion. For more information on the output of the netstat command, see TCP Connection States and Netstat Output on the Microsoft Support website.

    The following image displays ports which are in the ESTABLISHED and TIME_WAIT states, that is, which are either in use for an active connection or which have not yet been released to the system for reuse. If the entire dynamic port range matches the image below, then Tableau Server is experiencing port exhaustion.

Solution

  1. Increase the dynamic port range.

    You can start by setting the range to include ports 32767 through 65535. This range does not impact ports used by Tableau Server. Also, note that port 65535 is the maximum port number.

  2. Run the following command to increase the dynamic port range:

    netsh int <ipv4|ipv6> set dynamicportrange <tcp|udp> start=number num=range store=<active/persistent>

    In our example, the command would look like this:

    netsh int ipv4 set dynamicportrange tcp start=32767 num=32768 store=persistent

    where:

    start=32767: The first port of the dynamic port range is 32767.

    num=32768: The dynamic port range uses 32,768 ports, beginning with the start port.

    store=persistent: The dynamic port range is stored for the next time that the system restarts.

For more information about setting the dynamic port range, see the set dynamicportrange section of the Netsh Command Reference.

Next steps

In this example, the dynamic port range has been set to include ports from 32767 through 65535. However, if you continue to experience problems with port exhaustion, you can increase the dynamic port range even further.

For information about how to decrease the time before dynamic ports are released for use and how to set the dynamic port range directly in the registry, see Avoiding TCP/IP Port Exhaustion on MSDN.

 

Did this article resolve the issue?