IIS 7 and Above
Maximum Concurrent Connections - What is the true value?
Last post Jun 20, 2019 10:43 PM by psborugadda
Nov 08, 2018 09:07 PM|VincentW|LINK
Not sure if this should be here in "Performance" or in another section but the I put it here because I'm having a performance problem and I'm considering maximum concurrent connections as a possible culprit.
Unfortunately I'm not sure what my maximum concurrent connections value actually is because I'm seeing two different values.
I suspect that these two values actually are two different things, and so I need to know what exactly I'm looking at.
The reason I'm looking at this is because my website is very busy and just in the last week or so I've been getting complaints that people are seeing the "The service is unavailable" message. So I just want to rule out the possibility that I'm
going over my max connections.
Nov 08, 2018 09:30 PM|lextm|LINK
In IIS I select my website and click "Advanced Settings" and in the Limits section there is a value called "Maximum Concurrent Connections" and that value is 4,294,967,295.
https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/sites/site/limits It is a per site limit, which does not associate with "The
service is unavailable".
At application pool level, there is another queue length, https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/applicationpools/add/
which controls when the web browsers receive 503 (The service is unavailable). You can read HTTP error log https://docs.microsoft.com/en-us/windows/desktop/http/types-of-errors-logged-by-the-http-server-api to
confirm if your users saw 503 when IIS logged "ConnLimit".
Nov 09, 2018 08:45 PM|VincentW|LINK
It looks like HTTP error logging is not enabled on my server so I can't confirm if I it was a "ConnLimit" by looking at the log. However, I did confirm that the server was generating too many connections when executing a specific report.
I suspected a particular report, and while watching the performance monitor showing both the current connections (which bounced around between 30 and 100) and the maximum connections which was showing 1155, I executed the report and sure enough the current
connections value started to climb and within about 15 seconds it had passed the red line and my server started giving the "Service is unavailable error". So that tells me that the 1155 is the actual maximum connections before bad things happen.
And it sounds like you're saying that the 1155 is the application pool connection limit (not the site limit) which is actually defined by
Queue Length. Except the Queue length on my application pool is still set at
1000, which is the default. So where does that 1155 come from?
EDIT: I just noticed that I originally posted that value as
1138 yet today it's showing 1155. (I thought the number sounded different) So apparently this is not a static value. I'm guessing its calculated somehow.
Nov 10, 2018 01:32 AM|Rovastar|LINK
Nov 10, 2018 01:40 AM|Rovastar|LINK
Nov 10, 2018 02:29 AM|VincentW|LINK
Web Service" --> "Maximum Connections" is the maximum amount of connections the site has had since (I think the last restart of IIS (or it might be server)).
If that's the case, then why was I seeing "The service is unavailable" when hitting that threshold?
You probably need to look the concurrent connections to see what is happening. If your report running creates hubdr3ds or thousand of connections you likely have an issue with the code in your report.
Yes, there was a problem with the report. I was queueing up a bunch of ajax calls, and one of those calls was getting caught in an endless loop. That's all fixed now, but I'm still trying to understand this max connections thing.
Nov 10, 2018 02:31 AM|VincentW|LINK
Or just look at the worker process icon under the server in IIS manager to see the requests live.
Thanks for the tip! I never even realized that was there.
Jun 20, 2019 10:43 PM|psborugadda|LINK
The counter "Web Service" --> "Maximum Connections" is directly impacted by the site's setting "Advanced Settings" -> "Limits" -> "Maximum Concurrent Connections".
XMLHttpRequests. A batch of 71 calls were repeated with a wait time of 1 millisecond ). And the counter "Maximum Connections" also had the maximum value reduced, to the value set in the site's setting "Advanced Settings" -> "Limits" -> "Maximum Concurrent