1

We are hosting about 40 sites in our environment and on a daily basis some sites are going down and after app pool recycle we are able to bring the sites up.

We are using .net 4.0 as framework and iis 7.5 as our settings.

The app pool recycle timings are set at 1740 mins.

So what kind of setting should i change to avoid the site's down times.

Let me know if you need any further details.

Thanks, Vivek

4
  • You forgot to ask a question!
    – Khaled
    Jan 15, 2013 at 11:25
  • :), How to prevent this, will add it on the question too, even though its in the header
    – Vivek
    Jan 15, 2013 at 11:31
  • So all of these sites run in the same App pool? If so, I would change that.
    – joeqwerty
    Jan 15, 2013 at 12:32
  • NO , each site has its own app pool
    – Vivek
    Jan 15, 2013 at 13:36

2 Answers 2

2

First, check the Event Viewer and see the cause of the Recycle.

Second, I recommend changing the Recycle time to a specific time each day - that will allow you to control when the application pool recycles. Maybe configure this to a "quite" time.

Lastly, check the "Advanced Settings" in your Application Pool, there is a setting for "Idle Time-out (minutes). By default it's set to 20, that means that if there are not requests to that application pool, it will stop, and upon first request - restart again. Change it to 0 to always keep it on.

7
  • Thanks, but if i change the idle timeout settings will it affect any other performance parameter of the server/site?.
    – Vivek
    Jan 15, 2013 at 12:30
  • What happens when an application pool hits the idle-timeout is that the w3wp process stops, meaning it will free-up resources, but when it starts again they will be consumed again.
    – Idan
    Jan 15, 2013 at 12:41
  • yes, exactly, but my question is like when w3w process stops and starts will the site go down in between?
    – Vivek
    Jan 15, 2013 at 13:40
  • 1
    @Vivek No. There only be a small delay (delay depends on how busy system is -- request will be waiting in a queue) until worker will start -- then queued request will be processed as usual. Simply speaking "recycling app pool" is the same as stopping that specific w3w process (worker) and launching it again.
    – LazyOne
    Jan 15, 2013 at 15:14
  • @VivekIyer By removing the idle-timout you simply eliminate the delay. An important thing to remember is that when idle-timout hits, and the app-pool stops, SessionState is cleared (if it's in-process), regardless the timeout of the actual application.
    – Idan
    Jan 15, 2013 at 15:44
1

An alternative solution to this problem is to upgrade Windows/IIS. IIS 8 natively supports overlapping recycles (IIS 7.5 requires the Application Initialization Module). This feature causes your application to continue running, with the recycle occuring separately. This results in a seamless recycle (i.e., no downtime during a recycle). Optionally, it can be configured to warm-up any caches by hitting popular URLs.

1
  • Would be nice if this feature worked. Logs show multiple calls to Application_Start when a recycle occurs. One of the two calls never completes (based on absence of logs called at end of function), plus all the requests block for about 90 seconds before the new process is healthy. With 4 calling threads, I see that 2/4 threads experience a 504 gateway timeout after 60s, followed by 30s calls that complete; meanwhile, the other 2/4 threads just experience a 90s wait and complete successfully. So, double restart, with half the calls getting a 504, plus the 'initializationPage' is never called.
    – Triynko
    Jan 11, 2022 at 0:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .