Web Api requests persistent work in IIS (in state: ExecuteRequestHandler)

I am currently experiencing some hangs in the production environment and after some investigation I see a lot of requests queuing in the application pool worker process. The common thing is that every request that has been in the queue for a long time is a web api request, I am using both MVC and web API in the application.

Requests are queued for about 3 hours , when the application pool is recycled, they immediately start the queue.

They are all in the ExecuteRequestHandler state

Any ideas on where should I keep digging?

+4


source to share


2 answers


Your requests can be stopped for several reasons:

  • they are waiting for I / O, like database, web service call
  • they are looping or performing operations on a large data set
  • intensive cpu operations
  • some combination of the above

To see what your requests are doing, start by getting long URL requests.

You can do it in cmd line like this



c:\windows\system32\inetsrv\appcmd list requests

      

If it's not obvious from the urls and looking for code, you need to dump the w3wp.exe process on the server. Once you have a process dump, you will need to load it into windbg to analyze what is happening in all CPU cycles. The windbg coverage is pretty big, but here's a quick summary of what you need to do:

  • load SOS dll (managed debug extension)
  • runaway command call
  • to get a list of long streams plunging into a long stream by selecting it and calling! clrstack command

There are many blogs out there about using windbg. Here's one example . An excellent resource for analyzing these types of problems is the Tess Ferrandez blog .

+2


source


This is a really long snapshot with no direct access to your system, but try checking the handler mappings in the IIS Manager for your WebApi. Compare it to the IIS settings of your DEV or any other Env where it runs.

IF this is not a problem, then compare all other IIS settings for this application.



Good luck.

0


source







All Articles