Symptoms
-
Plesk, as well as webmail and other services, are not accessible, the following error message appears:
ERROR: PleskMainDBException Only one usage of each socket address (protocol/network address/port) is normally permitted
-
Migration from another Plesk server hangs with the same error.
- Backup is created with the same error message.
Cause
All available network ports on the machine are exhausted.
TCP/IP port exhaustion can occur on a server if the server is engaging in an unusually high number of TCIP/IP socket connections. This can occur if many client applications are initiating connections.
If all of the available ephemeral 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 client applications that attempt to connect to a server via TCP/IP sockets.
TCP/IP port exhaustion is more likely to occur under high load conditions, than under normal load conditions.
Resolution
Note: If the following command will show a value close to maximum
65534
netstat -n | find "WAIT" /c
63448
then it’s necessary to configure the firewall to temporarily block IP addresses having the highest connection count and go to step #2
-
Increase the upper range of ephemeral ports that are dynamically allocated to client TCP/IP socket connections.
-
Browse to, and then click the following key in the registry:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters
-
On the Edit menu, click,
New
and then add the
DWORD Value
– The max by default is
MaxUserPort
. It can be set up to
5000
(decimal).
65534
-
Close Registry Editor.
Note: reboot the operating system for this change to take effect.
Note: Increasing the range of ephemeral ports used for client TCP/IP connections consumes Windows kernel memory. Do not increase the upper limit for this setting to a value higher than is required to accommodate client application socket connections so as to minimize unnecessary consumption of Windows kernel memory.
-
-
Reduce the client TCP/IP socket connection timeout value from the default value of
seconds. Length of time that a connection stays in the
240
state when the connection is being closed. While a connection is in the
TIME_WAIT
state, the socket pair cannot be reused
TIME_WAIT
-
Start Registry Editor.
-
Browse to, and then click the following key in the registry:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters
-
On the Edit menu, click
,
New
, and then add
DWORD Value
– decimal value between 30 and 240.
TcpTimedWaitDelay
-
-
Close Registry Editor.
Note: reboot the operating system for this change to take effect.
For more information, refer to the following Microsoft KB articles:
https://technet.microsoft.com/en-us/library/cc938196.aspx
https://technet.microsoft.com/en-us/library/cc938217.aspx
Â