when should I schedule app pool recycles?

716 views Asked by At

I am currently setting up asp.net mvc site, wcf services etc in IIS 7.5. I am currently configuring the application for app pool's and have a question around app pool recycles. Each of the application rely on each other. At present there are no memory issues with any of the applications but at times we do have CPU issues with one of the applications.

The applications support multiple timezones, from Europe to Australia, so as such there are no times where the applications have a period of "downtime".

So on the topic of recyles, I am not sure what to set up here. Should I attempt to include some time based recycling or look at a possible other approach? I am not sure its correct to have no recycling of the app pools.

2

There are 2 answers

0
chue x On

My understanding is that an app pool recycle should be transparent to the end user (application). From Thoughts on Application Pool Recycling and Application Availability:

When you recycle an application pool, HTTP.SYS holds onto the client connection in kernel mode while the user mode worker process recycles. After the process recycle, HTTP.SYS transparently routes the new requests to the new worker process. Thus, the client never "loses all connectivity" to the server - the TCP connection is never lost - and never notices the process recycle.

Assuming the above is true, then you should not have to worry about when to recycle.

Disclaimer: I am not speaking from experience, but rather have seen several MSDN articles indicating the above. As always, you'll want to test.

0
Andrew Westgarth On

Scott Forsyth has a great article on the background to application pool recycle defaults - http://weblogs.asp.net/owscott/archive/2013/04/06/why-is-the-iis-default-app-pool-recycle-set-to-1740-minutes.aspx. Essentially the guidance I would give alongside Scott's article is to look at your usage data and work out when is the right time slot for when your services/applications have lowest usage.