views:

22

answers:

1

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.

+2  A: 

This is some of the reason that you may think and check for.

  1. a command that shut-down the app.
  2. a bug/closed loop that crash the app.
  3. a memory limit on the application pool that shut-down the app. (this is the most possible)
  4. a very bad iis and pool configuration on a shared server or on a virtual server. Maybe too many sites on the same iis, and at the same time a bad pool setup ?

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.

Aristos
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
@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
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