We are using a Windows Service to make very frequent HTTP calls to an internal REST service (20-40 calls per second), but notice a long delay in getting responses after the serv
There is a limit in the number of simultaneous outgoing HTTP connections. You can control this by using the System.Net.ServicePointManager.DefaultConnectionLimit
static property before creating the HttpWebRequest
objects
It might be worthwhile setting this to a higher value than the default which I believe is 2.
If this does not help then you can also increase the default ThreadPool
size to allow you to create more requests quicker. The thread pool only ramps up its number of threads gradually - a new thread per every half second, IIRC