HOWTO: Maximize the Number of Concurrent Connections to IIS6

Question:

I'm considering building a realtime ASP.NET application on IIS6, that'll need to support about 3,000 simultaneous users on a server, each with a keep-alive HTTP connection for "server push."

The HTTP connection will need to stay open for the duration of the user's session, to allow updates to be pushed to the browser in near real time.

My question is, is this technically feasible on IIS6, particularly with the large number of connections? If it's possible, are there any special considerations to get it to work?

Thanks in advance.

Answer:

Yup, IIS6 can easily handle 3,000 concurrent keep-alive connections, assuming you:

  1. Have sufficient HW resources (like RAM) on the system
  2. Reconfigure the system (i.e. tweak any applicable limits)
  3. Run scalable user software that handles the user load (i.e. uses asynchronous IO, not necessarily multi-threaded, has appropriate caches, etc)

Windows Server 2003 and IIS6 come configured for security out of the box, whose goal frequently opposes performance/scalability. For example, ability for the system to hold 3,000 connections ties up valuable system resources and can be considered a "security threat" given the right context. Now, one may want to make the tradeoff for functionality... but last I checked, software is neither clairvoyant nor omniscient (well, neither are humans, but that is a separate tangent altogether ;-) )... so one may need to do some tuning.

In your situation, there are a couple of non-obvious limits:

MaxConnections (HTTP.SYS)

Controls the number of simultaneous HTTP connections (and hence limits number of simultaneous connections serviceable by IIS6).

  • On Windows Server 2003 RTM x86, this comes out to around 8,700
  • On Windows Server 2003 SP1, the limit has been removed
  • On Windows Server 2003 SP1 x64, since NPP is bound by available memory, you can increase concurrent connections by merely adding more RAM. To give a sense of scope - I have seen 50K+ concurrent connections to IIS6 on WS03SP1 x64 with 4GB RAM
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters
Type: DWORD
Value: Range from 0 to 2^32-1

MaxUserPort (TCPIP.SYS)

Controls the max port number that TCP can assign. Every unique client making a request to your web server will use up at least one of these ports on the server. Web applications on the server making outbound SQL or SMB connections also useĀ up these ports on the server... so it highly affects the number of concurrent connections. For SMB tuning, read the de-facto IIS6 and UNC Whitepaper.

 HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Type: DWORD
Value: Range from 5000 to 65536

Conclusion

Incidentally, default value for both are above 3,000, so given sufficient HW resources like RAM and well written application software, IIS6 should just work for you out of the box without any tuning. :-)

//David