Search code examples
apachetomcatiis-7restartapplication-pool

Do we really need to restart IIS 7 application pool? Do the same practice apply to other web servers?


I am just wondering why is restarting IIS 7 application pool consider a good practice? I know that it'll clean up orphan resources like threads or session state, but how does other web server deal with this kind of problem? Do java developer/admin have to restart weblogic/websphere/apache/tomcat every so often to clean up junk in memory?


Solution

  • Typically it's used to compensate for bad programming. Sometimes yours, sometimes third parties depending on the libraries you are using.

    And, as with all recommendations, it's best to look at your specific environment to see if it's really necessary before doing it.

    Start with profiling the app. A simple way is to just let it run for a while under load. Look for things like does memory utilization settle down or does it continually grow?

    If it keeps growing, you will need to set IIS to recycle every so often and go fix your app. If it grows to a point then settles down then you should be just fine. Make sure you test even the edge cases of your app.