Maximum Concurrent Connections - What is the true value?RSS

7 replies

Last post Jun 20, 2019 10:43 PM by psborugadda

  • Maximum Concurrent Connections - What is the true value?

    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.

    1. 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.
    2. In Performance Monitor, I add a counter under "Web Service" called "Maximum Connections" and this value is displayed on the graph as 1,138.

    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.  

  • Re: Maximum Concurrent Connections - What is the true value?

    Nov 08, 2018 09:30 PM|lextm|LINK

    VincentW

    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".

    Lex Li
    https://lextudio.com
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Maximum Concurrent Connections - What is the true value?

    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.

  • Rovastar Rovastar

    5406 Posts

    MVP

    Moderator

    Re: Maximum Concurrent Connections - What is the true value?

    Nov 10, 2018 01:32 AM|Rovastar|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)).

    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.
    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Rovastar Rovastar

    5406 Posts

    MVP

    Moderator

    Re: Maximum Concurrent Connections - What is the true value?

    Nov 10, 2018 01:40 AM|Rovastar|LINK

    Look to see if you have requests queuing. There are various perfmon stats to see how many requests you have queued.
    Or just look at the worker process icon under the server in IIS manager to see the requests live.
    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: Maximum Concurrent Connections - What is the true value?

    Nov 10, 2018 02:29 AM|VincentW|LINK

    Rovastar

    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?

    Rovastar

    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.

  • Re: Maximum Concurrent Connections - What is the true value?

    Nov 10, 2018 02:31 AM|VincentW|LINK

    Rovastar

    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.

  • Re: Maximum Concurrent Connections - What is the true value?

    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".

    I tried reducing the value for site's setting "Advanced Settings" -> "Limits" -> "Maximum Concurrent Connections", and restarted the server. I made lot of calls to the APIs served by the website (calls were made using JavaScript code which makes sequential 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 Connections".