iisasp.net-web-apirequestiis-8request-queueing

Web Api Requests Queueing up forever on IIS (in state: ExecuteRequestHandler)


I'm currently experiencing some hangs on production environment, and after some investigation I'm seeing a lot of request queued up in the worker process of the Application Pool. The common thing is that every request that is queued for a long time is a web api request, I'm using both MVC and Web API in the app.

The requests are being queued for about 3 hours, when the application pool is recycled they immediately start queueing up.

They are all in ExecuteRequestHandler state

Any ideas for where should I continue digging?


Solution

  • Your requests can be stalled for a number of reasons:

    In order to find out what your requests are doing, start by getting the urls of the requests taking a long time.

    You can do this in the cmd line as follows

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

    If its not obvious from the urls and looking at the code, you need to do a process dump of the w3wp.exe on the server. Once you have a process dump you will need to load it into windbg in order to analyze what's taking up all the cpu cycles. Covering off windbg is pretty big, but here's briefly what you need to do:

    There are many blogs on using windbg. Here is one example. A great resource on analyzing these types of issues is Tess Ferrandez's blog.