Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

closed as too broad by kasperd, Jenny D, Jim B, MadHatter, Katherine Villyard Mar 7 at 20:17

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

4  
Is this a SQL server or client? Server processes generally only use 1 port, the well-known port assigned to that service. – Barmar Feb 23 at 1:05

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.

share|improve this answer

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

share|improve this answer

Split the server role to other server if the load is too big.

In example, in windows if you virtualize a Windows Server Standard license you can got two running instance free in virtual (1:2)

Other idea to give more physical's interface or virtual IP could help in the short term, but having such role (SQL, Gateway and user connection to the internet) is not a good idea.

In example, if a user get a malware and flood your gateway it will put down other service on the server.

share|improve this answer

There are only 65,535 available ports available in TCP/UDP. It's a restriction that is an inherent part of IP (the protocol).

You might be able to work around the limit by assigning more than one IP address to the machine that is opening all these connections.

share|improve this answer
    
The number of ports in TCP or UDP have nothing to do with IP, since IP can carry a variety of layer-4 protocols besides TCP and UDP, and not all of them even use ports. The layer-4 address (port) is part of both the TCP standard and the UDP standard, but it not part of the IP standard. – Ron Maupin Feb 24 at 5:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.