IIS and Web Servers
IIS Application Pool
Gravatar is a globally recognized avatar based on your email address. IIS Application Pool
  Craig Tucker
  All
  Jan 25, 2019 @ 11:46am

Hi Rick, General question because I am seeing two separate answers for this question...

The default application pool recycle is "Checked-Regular time intervals in minutes" with a default value of 1740, which is 29 hours.

So the question is, when the application pool recycles, does it crap on anything that is currently running or does it shutdown gracefully then recycle?

What do you recommend for this setting for high volume websites? Thanks, Craig

Gravatar is a globally recognized avatar based on your email address. re: IIS Application Pool
  Rick Strahl
  Craig Tucker
  Jan 25, 2019 @ 07:32pm

IIS uses staggered shutdown - it starts a new instance and routes requests to the new instance, but any requests that are still running will complete on the old instance.

So it's pretty safe.

If you're running Web Connection that's all that's needed. If you're running ASP.NET applications you might have to content with Session state getting blown away on a recycle operation.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: IIS Application Pool
  Craig Tucker
  Rick Strahl
  Jan 28, 2019 @ 12:59pm

Very interesting! Thanks much

Gravatar is a globally recognized avatar based on your email address. re: IIS Application Pool
  Keith Hackett
  Rick Strahl
  Jan 30, 2019 @ 07:03am

As an addendum to the session state getting blown away on a recycle operation, the issue can be addressed by switching the SessionState to State Server as found here, https://docs.microsoft.com/en-us/iis/application-frameworks/scenario-build-an-aspnet-website-on-iis/configuring-step-2-configure-asp-net-settings#212

I'm not sure if it mentions it in this guide or not but you'll also want to set the ASP.NET State Service to Automatic under the Services for the web server.

Gravatar is a globally recognized avatar based on your email address. re: IIS Application Pool
  Rick Strahl
  Keith Hackett
  Jan 30, 2019 @ 12:13pm

The best strategy is not using Session state at all.

Using Auth/Identity you can track a user along with some small bits of data (username/name/level etc) stored in an encrypted cookie and that avoids the overhead of Session state services.

+++ Rick ---

© 1996-2019