We have a problem on one of our production servers (Windows 2003 server). It appears all app pools are recycling every 10 seconds or so (all at the same time). Needless to say this is negatively affects applications' performance.

- application caches are lost
- debug statements in application startup code are triggering
- background threads are stopped

Other things I discovered:
- surprisingly the w3wp.exe processes remain stable
- no anti virus running on that machine
- attempted to disable file change notification by adding <httpRuntime waitChangeNotification="1000000" /> and <compilation numRecompilesBeforeAppRestart="100000" /> to one of the applications, but it didn't help
- nothing suspicious in the Event Viewer

Not sure what else to try here.


You need to enable IIS Health Monitoring logging. It records the reason for the restart in the Application Event Log. You should not disable file change notification because there should not be anything changing in the web site at all. Any files/data that are created/modified/deleted should reside outside the web site folder structure.

This is now built-in to the Application Pool gui in IIS 7. To enable this in IIS 6, you can add the relevant information to the web.config. You specifically want to log the "Application Lifetime Events".

    <healthMonitoring enabled="true" heartbeatInterval="1">
        <add name="HeartBeat" eventName="Heartbeats" provider="EventLogProvider" profile="Default" minInstances="1" minInterval="00:01:00" maxLimit="Infinite"/>
        <add name="App Lifetime" eventName="Application Lifetime Events" provider="EventLogProvider" profile="Default" minInstances="1" minInterval="00:00:00" maxLimit="Infinite"/>

Using Health Monitoring Events

  • ok, that got me a bit further... Now I get "Event message: Application is shutting down. Reason: A subdirectory in the Bin application directory was changed or renamed." event in the Event Viewer. Funny thing is, there are no subdirectories in the bin folder... – liho1eye Mar 4 '13 at 16:52
  • There may have been at the time the event was logged. You may want to enable object access auditing on the server and the folder where the offending changes are occurring. – Greg Askew Mar 4 '13 at 16:56
  • +1 for now... this last part will take some time to work out since it depends on domain security and I don't have access there. – liho1eye Mar 4 '13 at 20:29

Do you have the necessary permissions to deny write access to the bin folder for a while? If you do this then if something is writing to the folder the error may surface and you can trace it down from there.

Worst case scenario if nothing errors then at least your app pool won't get recycled because the bin folder won't be changing.

Another alternative is to use Process Monitor from Microsoft and watch the folder to see what access is happening. This will show you the files that are read/written and any processes that access it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.