On my Windows server I have a port open listening to incoming TCP connections from multiple clients. Is there a limit to the number of unique clients that can concurrently establish a socket connection on that opened port on my Windows server? One of the threads What is the theoretical maximum number of open TCP connections that a modern Linux box can have talks about number of socket connections being limited by the allowed file descriptors on Unix platforms. Is there such a limitation on the latest available Windows servers? If so how to go about changing that limit?
2 Answers
Based on an answer by a MSFT employee:
It depends on the edition, Web and Foundation editions have connection limits while Standard, Enterprise, and Datacenter do not.
Though as Harry mentions in another answer, there is a setting for open TCP connections that has a limit of a bit over 16M.
But while technically you could have a large amount of connections, there are practical issues that limit the amount:
each connection is identified by server address and port as well as client address and port. Theoretically even the number of connections two machines can have between them is very large, but usually the server uses a single port which limits the number. Also rarely a single client would open thousands of connections, but in NAT cases it may seem like it
the server can only handle a certain amount of data and packets per second, so a high speed data transfer or lots of small packets may cause the number to go down
the network hardware might not be able to handle all the traffic coming in
the server has to have memory allocated for each connection, which again limits the number
also what the server does is an important issue. Is it a realtime game server or a system delivering chess moves between people thinking their moves for 15 minutes at a time

- 30,146
- 9
- 61
- 74
-
@HarryJohnston But that is impossible to say without hardware information and used software. Also the question mentioned hard coded limits in Linux, which don't exist in Windows. So yes, of course you can't expect a slow machine with single NIC to handle a million active FTP connections, but a hefty machine might handle the same, or a trillion connections for a chess server. – Sami Kuhmonen Jan 10 '16 at 21:37
-
1There actually does seem to be a fixed limit (see my answer) but in practice the points you raise are more important. – Harry Johnston Jan 10 '16 at 22:05
-
Thanks Sami, Harry for your excellent info and insights. In my case there are multiple clients each initiating a connection and keeping it alive as it sends periodic data. This is basically some sensor data (like temperature for example) coming from the field. Hence there can be multiple clients at the same time talking to the same port on the server. It seems then that rather than connection limit memory, network hardware may be more of a limitation. We will be starting some stress tests soon. – Rahul J Jan 13 '16 at 06:41
In addition to the licensing and practical limits outlined in Sami's answer, there is in fact a configurable limit to the number of simultaneous open connections, determined by the TcpNumConnections setting. The default value is also the maximum, which is just shy of 16M.
(The linked documentation is for Windows 2003. The corresponding documentation for later versions of Windows Server does not appear to exist. However, I can't find anything to suggest that the setting has been removed.)
In practice, however, you are likely to run into the practical issues outlined in Sami's answer long before you hit this. (Unless the system administrator has manually changed the setting, of course.)

- 35,639
- 6
- 68
- 158
-
True, I can't find any information that would say this wouldn't still be the maximum allowed, even though there is not a clear indication that it would be true either. But I also would go on the side that it exists since there are mentions about at least WS 2008. – Sami Kuhmonen Jan 10 '16 at 22:13