ASP.NET Application ending immediately after starting
ASP.NET Application ending immediately after starting
Having a bit of a problem with my hosted ASP.NET applications. I noticed slowness when opening pages, the kind of slowness that you see the first time you start up an ASP.NET app. After researching, I'm finding that the Application_End event is firing shortly after the application starts, apparently killing the sessions, static values, etc.
I have the standard default web.config set up, and I am writing to the session when a page is requested. But for whatever reason, the application isn't waiting 20 minutes (or whatever the default is) before dying - sometimes it's just a minute or two, sometimes even less.
Of course, this doesn't happen locally in my dev environment - everything works as expected, with identical code and web.config values.
There is only one server, so no farm or anything like that.
I know that there are many things that cause an ASP.NET app to end - IIS restarting, app pool recycling, DLL or config file modified, reboot, etc. But I'm hoping to have a better guess when I report this to my hosting company, to help research and fix the problem. The server isn't being rebooted, and I'm not modifying any files, so that seems to leave IIS or the app pool restarting, unless I'm missing something else.
IIS restarting is in the Windows Event Viewer, so that's easy enough to find. Assuming that's not it, is there any way to determine exactly why the app keeps resetting?
Any thoughts you may have on this would be appreciated.
@Darin: If it's IIS restarting, it would, but I don't think normal app recycling or app starting/stopping get logged in the event log, do they? Do they get logged anywhere?
– Joe Enos
Sep 29 '10 at 6:45
the App pool restarts probably because it crashes. Crashes get logged. If you observe this behavior on the first request then it is possible that an exception is thrown in the Application_Start method during initialization.
– Darin Dimitrov
Sep 29 '10 at 6:46
@Darin: Worth a shot, I'll have them check it out.
– Joe Enos
Sep 29 '10 at 6:49
1 Answer
1
This is some of the reason that you may think and check for.
You can check for bugs on the global.asax
void Application_Error(object sender, EventArgs e)
by log all of them and check them out.
You can check the pool setup if you have access on the iis, or ask from the administrator to check it for you and remove the memory restart limits.
Thanks for the tips - I'm pretty sure the app's not crashing from my code - everything works locally. I'm asking the hosting company to look at the event viewer and the app pool settings to see if they can spot anything.
– Joe Enos
Sep 29 '10 at 7:09
@Joe you need to ask form your hosting company to check if they restart the pool on any memory limits. (and this you can not find it on log)
– Aristos
Sep 29 '10 at 7:59
My hosting company informed me that in order to combat memory problems, they put a 5 minute idle timer on the application pool - that didn't explain everything, since it died in less than 5 minutes often too, but it seems that they are definitely cycling the app pool at that end.
– Joe Enos
Oct 1 '10 at 5:41
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
The answer probably lies within the Event Log.
– Darin Dimitrov
Sep 29 '10 at 6:42