Max number of concurrent HttpWebRequests

Are all (or most) of your requests going to the same host by any chance? There’s a built-in limit on a per-host basis. You can change this in app.config in the system.Net connectionManagement element.

The other thing is that the thread pool only ramps up its number of threads gradually – it starts a new thread every half second, IIRC. Could that be what you’re seeing? Try getting rid of HttpWebRequest from the equation – just sleep for a couple of seconds instead…

I suspect the latter problem is the one you’re initially running into, but the first one is going to cause you problems as well.

Leave a Comment