A process serving application pool DefaultAppPool exceeded time limits during shut down

4683743 21 Reputation points
2021-11-11T16:40:51.413+00:00

My IIS is running for a while and does not respond, I check the event log and found this error happened in was service, I followed the solution on Microsoft's documentation, but this did not solve the problem. Is there an expert who can help me?

https://learn.microsoft.com/en-us/troubleshoot/iis/application-pool-exceed-time-limits.

Internet Information Services
0 comments No comments
{count} votes

Accepted answer
  1. Sam Wu-MSFT 7,036 Reputation points Microsoft Vendor
    2021-11-12T02:28:42.047+00:00

    @4683743

    The second resolution in the document, have you tried using the Debug Diagnostics Tool to capture a memory dump of the w3wp.exe process? about how to use Debug Diagnostics Tool to analyze crash memory dumps you can refer to this link: a-process-serving-application-pool-exceeded-time-limits-during-shut-down.

    The event logs included mutiple errors with different application pool. So please point out which application pool stop responding. The error message "exceeded time limits during shut down" means the application failed to finish all current requests inside the process before application pool shutdown timeout reached. So either threads hang up or locked up.

    Besides, in some case, http.sys will cause this issue because it is no longer able to wake up a new appliction pool. You may need to check whether your application pool is able to be waked up after your application stop responding.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Michael Taylor 48,581 Reputation points
    2021-11-11T17:27:01.417+00:00

    This indicates a problem in your app's shutdown logic. Most web apps don't have any shutdown logic. However when IIS needs to shut down an app pool it first waits for the app pool to finish processing any outstanding requests. If you have requests that take a long time to complete it is possible for you to get this error if they happen to be running when the shutdown is requested.

    Unfortunately the responsibility is on your app to do the right thing. In general your app should be using standard request time limits. This will mostly prevent this issue. However some people tend to increase the request time limit for their apps because they have requests that may take a while to run, rather than optimizing the code. In this case you would also often need to increase the shutdown timeout. But increasing the shutdown timeout is, in my opinion, a short term hack until you identify the actual problem.

    As noted in the link you gave, it may be harmless. If the app pool doesn't shut down in time then IIS will kill it. This will immediately terminate any requests but the process goes away and everything gets cleaned up. Of course if you were in the middle of writing a file or updating a database (without transactions) then you just corrupted your data.

    To diagnose the problem you should look at the scenarios where the error occurs. If you get this error when you make certain calls to your app then you should look at that code path to see what is taking so long. Using perfmon and monitoring the request execution time and related counters is a good place to start. I would recommend you add the monitoring of these counters (along with request queue lengths, timeouts and errors) and then run your web app through its paces. If you see high counts then identify the calls into the app that are causing them and start optimizing.

    0 comments No comments