Windows Server 2008 TCP connections limit

nettcpwindows

I run my own game server made in .net 4.5 on a Windows Web Server 2008 VPS. I have done some research on a problem I have. My app doesn't accept clients, if there are already 1000 clients connected. This app is basically a one process running six Socket servers (each on diffrent port) and has no limitations to connected clients in its code. Here is some stats:

-------------------------------Server ID: 0 stats
[22-03-2014 14:37:39] Stats: Players online: 160
[22-03-2014 14:37:39] Stats: Connections: 164
-------------------------------Server ID: 1 stats
[22-03-2014 14:37:39] Stats: Players online: 515
[22-03-2014 14:37:39] Stats: Connections: 535
-------------------------------Server ID: 2 stats
[22-03-2014 14:37:39] Stats: Players online: 108
[22-03-2014 14:37:39] Stats: Connections: 111
-------------------------------Server ID: 3 stats
[22-03-2014 14:37:39] Stats: Players online: 59
[22-03-2014 14:37:39] Stats: Connections: 61
-------------------------------Server ID: 4 stats
[22-03-2014 14:37:39] Stats: Players online: 74
[22-03-2014 14:37:39] Stats: Connections: 75
-------------------------------Server ID: 5 stats
[22-03-2014 14:37:39] Stats: Players online: 52
[22-03-2014 14:37:39] Stats: Connections: 54
-----------------------------------Total stats
[22-03-2014 14:37:39] Stats: Total players: 968
[22-03-2014 14:37:39] Stats: Total connected: 1000

"Player" clients are logged-in players, and "connected clients/connections" is the amount of sockets being listened at a time (logged-in players + players logging in).
Is it a Windows Web Server 2008 limitation?

Best Answer

It appears to me that you might be in violation of the license agreement since you are using 2008 Web Edition:

From Here:

Windows Web Server 2008 is specifically designed to be used as a single-purpose Web server . It is intended only for Internet accessible, front- end Web serving of Web pages, Web sites, and Web applications.

Anyway, the Web Edition of Server 2008 does indeed have a limit of 10 simultaneous half-open TCP connections, but no reasonable limit on active TCP connections, according to this Microsoft employee:

It depends on the edition, Web and Foundation editions have connection limits while Standard, Enterprise, and Datacenter do not.

But if you're consistently seeing the number of connections get stuck at exactly 1000, consistently, then I'm not yet convinced that half-open TCP connections are your problem. Couldn't tell you more without scrutinizing your code.

But you should probably move off of Web Edition anyway, since you are using it for something other than running a web server. So the best answer I think you'll get given the information you've provided to us is no, there is no limit of active TCP connections that is anywhere near 1000 that is imposed either by the operating system or by the .NET framework. It is capable of handling many, many more than that.

Edit: I suppose you could try changing the registry key HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\EnableConnectionRateLimiting to 0, but that may or may not work because of your Web Edition of Windows Server, as well as opening you up to possible denial of service attacks (if you actually are having a problem with half-open TCP connections, which I'm not yet convinced that you are. Run a netstat and see if you have a bunch of connections that seem to be stuck in a SYN_SENT state.)