Why does IIS randomly restart my web application?

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.


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.


Have you taken a look at this thread?

http://forums.iis.net/t/1157734.aspx


While it doesn't seem to have an immediate answer to your question it does appear that this is not an uncommon problem.

It also contains other links which may prove useful.