TCP/IP port exhaustion can occur if the server is engaging in an unusually high number of TCIP/IP socket connections. If all ports are allocated to client applications then the client experiences a condition known as TCP/IP port exhaustion. When TCP/IP port exhaustion occurs, client port reservations cannot be made and errors will occur in Qlik Sense that attempt to connect to a service via TCP/IP sockets.
Port exhaustion is more likely to occur under high load conditions than under normal load conditions such as pushing a lot of concurrent users to Qlik Sense.
Below is the error you will see that indicates this issue from PostgresSQL : " FATAL: remaning connection slots are reserved for non-replication superuser connections "
![User-added image](https://qlik.my.salesforce.com/servlet/servlet.ImageServer?id=015D0000003sC6e&oid=00D20000000IGPX&lastMod=1492498907000)
Error 4227, Tcpip is shown and Unable to read data from the transport connection
Error Transport channel is closed.??Transport channel is closed
Error No connection could be made because the target machine actively refused it
Error:The underlying connection was closed: The connection was closed unexpectedly
Resolution:
To increase the upper range of ephemeral ports that are dynamically allocated to client TCP/IP socket connections.
- Start Registry Editor.
- Browse to, and then click the following key in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
- On the Edit menu, click New, DWORD 32bit Value, and then add the following registry value to increase the number of ephemeral ports that can by dynamically allocated to clients:
- Value name : MaxUserPort
- Value data: <Enter a decimal value 65534 here
- If the MaxUserPort does not work please include TcpTimeWaitDelay
-
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters and set the value TcpTimedWaitDelay to 30 seconds.
On the Edit menu, click New, DWORD 32bit Value, and then add the following registry value to add a time delay to allow ports to close:
-
Value name : TcpTimedWaitDelay
-
Value data: <Enter a decimal value 30 here
This has been tested on Windows Server 2012/2012 R2 and Windows Server 2016
Note:
- You must restart your computer for this change to take effect.