IIS 7, websites hang until application pool reset

iis-7windows-server-2008

We have a couple of websites both installed on Windows Server 2008 R2 and IIS 7 that will occasionally hang unitl their respective application pool is recycled.

By hang I mean that the browser will try to retrieve the site, and will try loading it for a very long time, sometimes after 5-10 minutes it will start to display the web page, sometimes it shows nothing even after that time and the browser still appears ot be trying to load the web page.

The current work around is to log on to the server open IIS 7 console and recycle to worker process the website is attached to.

What causes this and how do we resolve this issue permanently?

Best Answer

Have you reviewed your IIS logs yet when this occurs? That may be the first place to start.

This can be caused by your application pool stopping or struggling due to too many errors. If you go to the advanced settings of your application pool, there is a Rapid-Fail protection section.

You can increase the failure interval and also the maximum failures(the amount of failures allowed in that interval), but this won't really solve your problem, but may prevent the frequency of it occurring.

Under the recycling section, you can also force the application pool to recycle automatically at specified intervals, but this can possibly cause some session data loss and reset some thing for your end users. This can also only help stop the frequency, but not the base issue of the problem.

The best thing to do is to find out why it is stopping. If this is an asp.net application, you can run a tool like elmah to log all your exceptions that are occurring in your application and work on getting those fixed.