iisasp.net-web-apiazure-application-insightsconnection-pool

Is IIS running out of connections?


Our IIS website has its Maximum Concurrent Connections set to 4294967295. Our Web API application is logging all the requests it serves to Application Insights and the two do not appear to match up. A call which appears to get served quickly in Insights does not appear to complete quickly in IIS's logs.

What could cause this and is this an indication that IIS is running out of connections, even if the maximum is set ridiculously high?

Phrasing this another way (after reading @zakima's comment): What should I be looking for to identify requests which are getting delayed in IIS before or after they hit the application itself?


Solution

  • Maximum concurrent connections defaults to 4294967295, which is a staggering number. But it does not mean that the site can have the ability to execute 4294967295 concurrent connections.

    Assuming that 4294967295 concurrent connections come at the same time, IIS does not immediately start 4294967295 threads to process, because this is unrealistic. For the processing of connections, IIS has the "Maximum concurrent worker threads" limit. From some sources, this number is related to the operating system. If IIS can only start 10 worker threads in the first time to process, then the other 4294967285 must queue.

    In another word, 4294967295 means the maximum amount of allowed by default concurrent connections from http.sys module to the site. Then these request will hit each module of IIS and hit application at last.

    If you want to check the real max concurrent connections of IIS, please refer to this article to use Performance Monitor.

    Regard to how to monitor the request getting delayed in IIS before or after, I suggest you use failed request tracing. Here is the sample of failed request tracing log of my asp.net application. enter image description here