4

We are suffering from random high number of ASP.NET\Requests Queued. When we look at IIS worker proccess requests, there are hundreds of request stuck in UpdateRequestCache as you can see in picture (along side many other requests get stuck in BeginRequest and EndRequest). When this problem happens, I have to recycle application pool.

  • OS: Win 2012 R2 Standard 64Bit
  • IIS 8.5
  • ASP.Net Application uses .Net 4.6.2 / MVC 5.2.2.
  • No custom HttpModule is used in Application.
  • CPU usage is fairly low (below 20%) when queue happens. Also there is plenty of RAM (more than 60%) available.
  • As you can see in the picture, hang occurs on two controllers which their responsibility is sending images to clients.

My question is what could be cause of hang in UpdateRequestCache?

Accourding to this document, UpdateRequestCache happens when ASP.NET finishes executing an event handler, so if my code is not optimized, How can the code affect the UpdateRequestCache?

enter image description here

  • 2
    did u chk https://stackoverflow.com/questions/10929922/asp-net-iis-when-are-requests-queued – Daniel B Oct 21 '17 at 15:50
  • @DanielBahmani I've tried all possible settings about maxWorkerThreads, minWorkerThreads, minFreeThreads. But no chance yet. Requests still get queued (sometimes in BeginRequest state, sometimes in UpdateRequestCache state) – Mohammad Reza Sadreddini Oct 21 '17 at 19:28
  • It' hard to simulate yr environment, do u have sth in yr web.config like impersonation & memory allocation? connection limits? max concurrent requests? concurrent timeout? did u check the advance settings of yr app pool? – Daniel B Oct 22 '17 at 00:21
  • chk also https://stackoverflow.com/questions/33709657/upgrading-from-iis-6-to-8-5-increased-concurrent-requests?rq=1 – Daniel B Oct 22 '17 at 00:22
  • did u find anything? u might set a bounty for this question to get other's attention https://stackoverflow.com/help/bounty – Daniel B Oct 24 '17 at 18:38
  • 1
    @DanielB As your first comment, I also do believe its something related to thread pool. So we are tuning MinWorkerThreads, but it takes time on production server to find a low-traffic hour to change settings. I'll keep you posted as soon as we find any clue. – Mohammad Reza Sadreddini Oct 25 '17 at 04:17
  • @MohammadRezaSadreddini Did you ever get to the bottom of this? – Marcus Feb 21 '20 at 14:45
  • @Marcus, Yes, It was because of thread count was higher than ThreadPool MinWorkerThreads. Increasing MinWorkerThreads did not helped so much. So we refactored our code to consumer less threads. Its a little tricky to find how many thread are working on and what are stack-trace of them. When u find problematic threads, Then u can refactor ur code to use less thread. – Mohammad Reza Sadreddini Feb 22 '20 at 06:01

0 Answers0