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

Vivek
  • 111
  • 1
  • 1
  • 4

2 Answers2

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.

Idan
  • 309
  • 1
  • 2
  • 7
  • Thanks, but if i change the idle timeout settings will it affect any other performance parameter of the server/site?. – Vivek Jan 15 '13 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 '13 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 '13 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 '13 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 '13 at 15:44
  • so what might be the reason for the site to go down, before doing app pool recycle we can see the worker process is around 500000 kb – Vivek Jan 16 '13 at 10:03
  • if no request is made to the site for 20 minutes (no-one is using it) then IIS will stop that worker and wait for the next request. Upon a request arriving to that site IIS will first create the W3WP process, that means the first request after the idle-timeout firing will be much slower. – Idan Jan 16 '13 at 12:13
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.

Brian
  • 303
  • 1
  • 3
  • 15
  • 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 '22 at 00:59