none
Application pool Recycle and ShutDown time limit RRS feed

  • Question

  • I am facing a problem while recycling an application pool. Let me explain my scenario.

    I have a long running WCF service running in a AppPool which will be triggered by a windows service. Recently I came across that after 29 hours my application pool is getting recycled. I came to know that during recycling a new worker process is created and the old worker process continues working on old in-flight requests until completed, or until the shutdown timelimit is reached.

    As my application is long running, during recycling old worker process should gracefully shutdown by completing its activity. In order to acheive this i increased the ShutDown Time Limit (seconds) to 7200(2hrs) from 90 secs(default value).

    When I tried to run my application after above changes, Recycling request is initiated after 29 hrs and the worker process is terminated after 5 mins (without completing its activity) . Am I missing any settings? Any help on this regard will be appreciated.

     
    Monday, March 18, 2013 12:44 PM

All replies

  • Hi,

    Please try to check the following to see if you have missed any settings:

    To modify the ShutdownTimeLimit value in IIS 6.0, please see the following documentation:

    #Configuring Startup and Shutdown Time Limits (IIS 6.0):

    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/26306fe4-6a15-467b-aa80-da438aa5137c.mspx?mfr=true

    To modify the ShutdownTimeLimit value in IIS 7.0 and IIS 7.5, please see the following documentation: 

    #Process Model Settings for an Application Pool
    http://www.iis.net/ConfigReference/system.applicationHost/applicationPools/add/processModel .

    For more information :http://support.microsoft.com/kb/2634635 .

    Hope it can help you.

    Thanks.



    • Edited by dns jinung Wednesday, March 20, 2013 9:05 AM
    Wednesday, March 20, 2013 9:03 AM
  • Thank you Eric for your response.

    I have tried the settings as mentioned in the above links with no success. Let me explain my scenario and my understanding the way the creation of worker process and apppool recycling works.

    I have created a small test application with following configurations to verify whether the ShutDownTime Limit concept will work or not during App-Pool Recycling.

        A simple WCF service with net.pipe binding. This service just logs in to a text file for every 10 secs till 20 mins.
        Running under a separate Application Pool.
        Application pool is running under a"Network Service" account.
        Recycle time 5 mins
        ShutDownTime Limit 1200 secs (20 mins).

    Following activities occur when a request is made to the service.
    1. The request will reach the application pool and submits the request to the worker process.
    2. Assuming the worker process starts processing a long running request(which takes 20 mins to complete) at 00:00:00.
    3. After 5 mins of processing i.e at 00:05:00, a recycle request is initiated.
    4. A new worker process will get created which takes care of new requests.
    5. Old worker process should continue processing the request till it either completes the process or ShutDownTime is reached which is 20 mins.

    It is observed that in our case the old worker process dies before the shut down time, nearly 5 to 6 mins after recycle request is initiated(5 to 6 mins is consistent for every run) thus not able to complete its process.

    Let me know if I am missing something. Thanks in advance.



    Wednesday, March 20, 2013 10:14 AM
  • Hi

    Is there any solution to this problem?

    I asked the same question at stackoverflow "IIS application pool ignores Shutdown Time Limit (seconds) with c# application" but so far there is no available solution.

    Is it a bug?

    There must be something inside IIS while the recycling by changing configuration behaves differently



    Thanks

    Monday, April 25, 2016 7:33 AM