ran out of tcp udp ports [closed]

How to resolve a Windows or Linux system that runs out of the tcp/udp ports on a single server? I have over around 65000 tcp/udp ports being used on a single server as a result of SQL connections, user connections for users to connect to the internet, and acting also as a gateway.


Solution 1:

I recommend to plan separation of roles (unless the gateway requires the SQL to be on the same host) - not due the fact that you're running out of ports. If the SQL is not required by the gateway and/or it's holding company data, it's quite risky to be on a gateway node.

Speaking of TCP, there are plenty of available ports. You may (while ignoring things like port sharing) only bind 216 ports per address, you may have far more active connections per address.

You can handle thousands of connections with even a single TCP port - the connection is defined due multiple parameters:

sourceIP:sourcePort:destinationIP:destionationPort.

See more here.

An important parameter may be half-open connections - if one of your services has some trouble, it may affect other services running on the system. You may get some more information here.

Solution 2:

Sounds like a heavy load server in an important role.

  • You can use more than one Ethernet interface - that would gain also physical expansion.

  • You can use more than one IP address on any interface - easy software solution.

I would also suggest to use a proxy / NAT eventually