Is there a way to monitor (log) the reason for restarting of an ASP.NET application?
We now having problem with rather complex site. It's restarting during file upload. Not on every file, but on every 5th-10th for sure. We use custom VirtualPathProvider, so this could be a reason. We also have a background worker threads, and this also could be a reason. It would be great to just know the reason.
Problem occurs on XP (IIS 5.1) and Windows Server 2003 (IIS 6).
Resolution:
Thanks guys, we've managed to catch it. It is caused by max recompilations reached. Most likely the problem is in our VirtualPathProvider, but this is completely different question.
Summary of approaches:
History of the IISRESET command With IIS 5.0 and earlier versions of IIS, the web server was a monolithic single process. The IIS restart command was needed for restarting the web server process to resolve performance issues that may have developed in the application.
Have you looked at the logging suggestions from "Logging ASP.NET Application Shutdown Events "? That would be my suggestion for a way to get more information about what is happening.
Adding or removing folders inside the applicaton folder will cause the app pool to recycle (the most likely reason in your case), along with many other things. Here's an interesting article:
http://blogs.msdn.com/johan/archive/2007/05/16/common-reasons-why-your-application-pool-may-unexpectedly-recycle.aspx
on the same site is some good hints on how to monitor the restarts which is what you were actually asking. The choices are web.config and EventViewer or Performance Monitor.
http://blogs.msdn.com/johan/archive/2008/02/18/monitoring-application-pool-and-application-restarts.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With