Iis – Why does IIS randomly restart the web application

asp.netiis

I was having issues with a website on my server which was occasionally losing session state.

I narrowed the problem to IIS7, so I added a method to the Application_Start event (it's an ASP.Net MVC app), which emails me every time the application is started and re-deployed the site about a week ago. I've been getting the 'startup' email every 26ish hours since.

So, I'm wondering why IIS would be restarting the app.

Best Answer

This is controlled by the recycling feature of the Application Pool the site resides in most likely. You can tweak this to recycling at set times or at longer intervals.