views:

344

answers:

2

I have a web server hosting an HTTP chat application that works with long-polling.

This means a client browser "polls" for new info and the server does not respond until there is info to send back, so the HTTP connection is left open for a long time, up to a minute.

My question is how many of these connections the server can handle open at the same time before it dies.
Of course, there is no precise number, but I want to get a grasp, an order of magnitude (1,000 , 10,000, 100,000?)

Any insights related to this based on any experiences you may have had is more than welcome!

+1  A: 

I found this:

http://blogs.msdn.com/david.wang/archive/2006/04/12/HOWTO-Maximize-the-Number-of-Concurrent-Connections-to-IIS6.aspx

To give a sense of scope - I have seen 50K+ concurrent connections to IIS6 on WS03SP1 x64 with 4GB RAM

Anything else you can find?

Daniel Magliola
+1  A: 

To be honest, in all but the most extreme of situations you will run out of resources for your application before you ever exceed the amount of supported connections. IIS can handle a crazy amount of pure network connections but it ultimately comes down to if your application can process data from them fast enough.

If you are really expecting to scale this to thousands of users at a time I would go ahead and build in your design to be able to scale out to multiple front-end servers. Most likely this would look like a load balancer or reverse proxy that balances these HTTP connections between front-end servers, with those front-end servers doing the processing and communicating with a central SQL DB or whatever your storage mechanism is.

Edit: One other note, regarding the single server scenario - regardless of how many connections IIS can handle, your firewall has its limits, too. Usually it's also a crazy amount but you'll need to look at your firewall too if you really want to find the ceiling.

routeNpingme
Two comments: Most of the time, our code is not doing ANYTHING, it's just holding the handle of the connection in case something happens that needs to be notified. I'm not saying it won't ever be a bottleneck, of course, but we can keep getting bigger and bigger servers if that's the case, and it truly is a very lightweight piece of code.
Daniel Magliola
As for splitting the servers: Yes, we have that idea for the future, but it implies a lot of effort that we'd rather use on building features for now. We are trying to figure out, for now, how long the single server scenario will hold. We will eventually have to move to multi-servers, but we'd like to hold that for as long as possible.
Daniel Magliola
That said, I don't expect our code to work with 65k connections. I thought the limit would be much lower (5-10k), in which case we could be hitting it.Thanks for your answer!
Daniel Magliola