Web Hosting Talk







View Full Version : Application Pool Recycle


jastoh
05-09-2010, 11:42 AM
Hi All,

I get intermittent session lost on my ASP.Net website and upon checking with my hosting provider, it is due to the recycle of the application pool at my hosting provider's servers every 90 minutes.

This means regardless if there are activities or if my sessions are left idle, they WILL be cleared after 90 minutes.

My question is, are there any workarounds to this? My hosting provider is suggesting me to go to VPS but I have no reason to do so since my website at the moment has very low traffic.

Is this the same for every other shared hosting plan? If so, how can websites using sessions actually not annoy their users when the sessions are cleared?

Thanks for the help!

PremiumHost
05-10-2010, 02:00 AM
I don't think there's any work around.
You can check with your host to see if they offer dedicated application pool.
On our servers, we set recycle every 10 hours.
90 minutes is quite low but still not too bad considering that noone would spend more than 60 minutes on a website?

Motiv
05-10-2010, 09:20 AM
I believe 90 mins is the default for an application pool to re-cycle. Only way to get around this is for the host to change that time to a higher value or to control it yourself as on a VPS/dedicated server.

(Stephen)
05-10-2010, 09:22 AM
I believe 90 mins is the default for an application pool to re-cycle. Only way to get around this is for the host to change that time to a higher value or to control it yourself as on a VPS/dedicated server.

This is not correct at all, 1740 minutes is the default time to recycle!

Motiv
05-10-2010, 09:28 AM
This is not correct at all, 1740 minutes is the default time to recycle!

Ah, heh. Coffee please. ::yawn::

So in response to the above OP - obviously your host set the application pool to recycle at that time - so as I said, the only way to raise it is to either ask them or control it yourself on a VPS/dedicated server if they won't allow that modification.

FourPoints
05-10-2010, 09:55 AM
I thought most of the control panels setup a seperate app pool for each site. Your host really should be giving each site, or at the least each account a seperate app pool to ensure stability of their sites against other people's poor code, as well as ensure security of your data (some server side variables (like session variables) can be accessed by any site running in that app pool. If you place data in a server side variable, then in theory, anyone else with access to that app pool can access that data.

(Stephen)
05-10-2010, 10:48 AM
I thought most of the control panels setup a seperate app pool for each site. Your host really should be giving each site, or at the least each account a seperate app pool to ensure stability of their sites against other people's poor code, as well as ensure security of your data (some server side variables (like session variables) can be accessed by any site running in that app pool. If you place data in a server side variable, then in theory, anyone else with access to that app pool can access that data.

There are disadvantages to own pools as well, if you don't get many hits they can die after 20 minutes even with a 1740 recycle time as there IS a default 20 min idle condition timeout.

In addition to this setting each site to own app pool takes up more RAM on the server, and makes loading the sites slower due to startup of w3wp on load if it was not started.

dazmanultra
05-10-2010, 10:58 AM
Ask if they'll let you have a dedicated application pool.

There are disadvantages to own pools as well, if you don't get many hits they can die after 20 minutes even with a 1740 recycle time as there IS a default 20 min idle condition timeout.

Set up a cron/schedule task to hit the main page of the site every 10 minutes. ;p

(Stephen)
05-10-2010, 03:33 PM
Set up a cron/schedule task to hit the main page of the site every 10 minutes. ;p

That would certainly be something I'd suggest a client do, however doing that for every client on a server as a host would result in a lot of overhead for such a task ;)

jastoh
05-19-2010, 02:21 PM
I was offered a dedicated application pool for only $5 a month. Little did I know that the dedicated application pool has a memory limit of 50MB. Now my sessions are lost not every 90 minutes, but every 3 minutes. My application is considered fairly efficient (with memory optimizations put in) and I was told 50MB is in fact too low for any ASP.Net application - unless it is a very simple application without any client server interaction etc.

Any thoughts on this? Are there any hosts which can offer a higher dedicated application pool? Or at least one which fixes a time to recycle their pools once or twice a day instead of every 90 minutes?

cagoon
05-19-2010, 03:43 PM
it sounds like you've managed to sign up with the worst host ever.

90 minutes is unacceptable. what if a user signs on minute 89? I would think about switching for sure. at least now you know what to ask!

BKerry
05-19-2010, 04:10 PM
it sounds like you've managed to sign up with the worst host ever.

90 minutes is unacceptable. what if a user signs on minute 89? I would think about switching for sure. at least now you know what to ask!

Why is it unacceptable? In a shared hosting environment it's the best way to keep performance at peak.

Store your information in cookies instead of sessions and you'll be fine. That's the workaround!

Motiv
05-19-2010, 04:46 PM
Why is it unacceptable? In a shared hosting environment it's the best way to keep performance at peak.

Store your information in cookies instead of sessions and you'll be fine. That's the workaround!

Yeah in a shared hosting environment that runs Pentium 4s... 90 minutes is worthless.

cagoon
05-19-2010, 05:08 PM
Why is it unacceptable? In a shared hosting environment it's the best way to keep performance at peak.

Store your information in cookies instead of sessions and you'll be fine. That's the workaround!

Or even easier than changing your perfectly fine application, find a decent host with decent servers that give you your own app pool and don't MURDER your app pool every 90 minutes because their servers can't take the heat.

yeah, your site will load slower the first time the app pool starts up.. so what? that's how it is. if you had your own app pool you can make it not shutdown on idle anyway..

Any host using win 2k8 will probably have that since that's the default for iis7.

protecweb
05-19-2010, 06:27 PM
You can ask your host if they support ASP.NET Session State via the server or SQL method (out-of-process). Both retain your session state outside of memory using either the server or MS SQL method. I would recommend the server method if you can get your host to enable the service. It works very well.
http://msdn.microsoft.com/en-us/library/ms972429.aspx

eoinbronks
07-30-2010, 09:13 AM
I was in an impression that the control panels usually set up a separate application pool for every website. It perhaps offers the site’s stability.