I would like to have as many connections (single connections from many different clients) as humanly possible in a server running on Windows Server 2008, in order to support a Comet-style application. The application is written in C#. The connections will not be chatty, they just need to be open (and stay open). Buying boatloads of memory and fast CPUs are not a problem.
As far as I can tell, I will be limited to 65k simultaneous open connections per NIC – the maximum number of ports. Is this accurate? Or can I go beyond 65k connections / NIC somehow? It seems like there are server products for Linux at least that support hundreds of thousands of connections. How do they do this?
Best Answer
You can go well beyond 65k connections; as you can have multiple connections per port (once accepted, the listener can connect to another client). One end or the other does have to have some difference, usually the client picks a random port. Windows is by default limited to a few more than 3000 of these random ports; so your typical client will max out around that. It's possible to configure the client differently however, and many *nix are limited to many more than Windows.
There's a registry setting limiting the maximum number of connections to 16 million. But there are other more practical problems that will usually limit you to less (you can change the registry value).