4

By default IIS has "Recycling" app pool settings set to "Regular Time Interval (minutes) == 1740" which makes the application pool restart every 29 hours no matter what happens and what load the server responds to.

How do I know if I need this "automatic recycle every N hours" policy enabled?

2 Answers 2

3

Depends on your application. I have some applications that i don't want to recycle when it's busy on the website. Therefore i changed the regular interval into Specific times. These time are late in the evening and early in the morning. This way the recycle doesn't interfere with the user interaction on the site.

For regular websites it wouldn't be a problem to have the regular interval.

Als you could choose to recycle based on requests and memory. This also depends on your specifications of the webserver (RAM).

1
  • What about not recycling at all?
    – sharptooth
    Feb 13, 2013 at 6:10
1

These are my thoughts on the matter, so it's best to perform your own research and arrive at your own conclusion. While it can be extreme, recycling should not be used to "resolve" a resource leak or a hang. If you are on an environment that is limited in resource and host multiple sites, then I can see recycling/throttling to best use resources. However, let's pretend I build a windows service instead of a website on IIS for a company. If my service would hang when running for 24 hours or would consume all the memory in a server and I don't state that in the specifications, asking to schedule a task to restart the service every 29 hours probably won't be acceptable to some customers and they would ask me to fix that. Well, that is what recycling is doing. Of course it brings a new worker process up before terminating the old one, but you will see the effects of a cold start of a worker process. Hence, I would recommend testing how the site runs without recycling or the idle-timeout and adjust accordingly.

1
  • In my case I have a Windows Service AND a Website which perform the same action -- The Windows Service does an automated action but when there is an error the user can manually initiate the same action from the website. Both the windows service and website intermittantly return false on a directory.exist using a unc path. If I recycle the app pool it works -- if I restart the web service it works. I have a domain user account as identity for both the windows service and app pool. Maybe this is a network permission issue or server timeout? We wrote some retry logic until we figure it out.
    – D. Kermott
    Sep 2, 2021 at 13:44

You must log in to answer this question.

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