TCP Server Memory management: #Connections Vs. #Requests

Posted by Andrew on Server Fault See other posts from Server Fault or by Andrew
Published on 2014-06-05T06:55:41Z Indexed on 2014/06/05 9:29 UTC
Read the original article Hit count: 257

Filed under:
|
|

Given that, there is no theoretical limit to number of concurrent TCP connections a Windows 2008 server can handle. Only thing will happen is, with each connection there will be memory consumption in server. Unfortunately, memory is not unlimited (and I want to utilize only physical memory).

For example, lets say we've 2GB server memory. Now there are two extreme cases:

  • Case 1: If we've allocated 64KB buffer for each connection (only to receive incoming request), then 32768 connections can consume all the 2GB of memory. This will not leave any memory to queue/process incoming requests from those connections.

  • Case 2: On the other hand, lets say a single (or very few) connections continuously keeps sending request buffers (for example, video streaming from one connection to other) and server cannot process them within time, those buffers will get piled up in server and eventually will occupy most of the servers memory. And it will not leave any memory for new connection thereafter.

This is the real dilemma in server design bugging me badly for last many days.

If I can decide on max size of request buffer per connection and max number of requests to allow in queue per connection. Then, based on available server memory, it will then automatically set limit on max number of concurrent connections.

How to decide on these limits to achieve best performance and throughput? I am just looking for perfect utilization of server resources.

Are there any standard guidelines or empirical data available with someone who can share with me please.

© Server Fault or respective owner

Related posts about windows-server-2008

Related posts about memory