Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

It seems that my asp.net sites on my web server are very slow to load if they have not been accessed in a while.

Does the ASP.NET processor go into suspend or sleep mode if it has gone unused for a period of time?

Is it better for me to fix this by configuring ASP.NET or writing some program to visit my sites every so often to keep it awake?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

Depending on your configuration the Application Pool assigned to your ASP.net application the AppPool will recycle at a certain time of day, or after a certain number of requests. Once this happens it forces ASP.net to recompile the site. There is a good overview on ASP.net compilation on MSDN.

There are also several questions on StackOverfolow:

There are two steps that I use to make this better:

  1. If possible try to avoid recycling the application pool at a time that someone is going to be using the site. You should be able to identify this by using Google Analytics or another traffic logging package.
  2. Setup something to hit your website shortly after your Application Pool has recycled, I use PolyMon extensively for my on-site servers, so I have a monitor that checks the site is healthy every 5 minutes which does this job for me. I have used SPWakeUp for SharePoint sites, which could probably be adapted for any ASP.net site.

As an example, if you were able to identify that your site is rarely used at 0200 you could configure your Application Pool as follows (IIS Config -> Right Click the AppPool -> Click "Recycling..."):

Windows 7 Application Pool Recycling Settings

The above dialog is from Windows 7, however I don't think the dialog has changed vastly between Windows 2008 and Windows 7/2007 R2.

share|improve this answer
2  
There is also an idle timeout, application pools will shutdown if no activity (requests) for that period. Look at application pool advanced settings. –  Richard Feb 20 '10 at 10:48
    
I did both things -- So far today my web server has not suspended. It did take 2 seconds on first load about an hour ago, but I think that's more of an operating system having to hit the hard-drive issue and I will need to look into caching to do better than that. Thanks for your advice –  George W Bush Feb 20 '10 at 20:02
1  
No, it is the app pool starting. It precompiles all code when it starts. –  TomTom Sep 25 '10 at 5:54
    
@TomTom Not all of the code... it only loads all of the pre-compiled DLLs and runs any app startup and session startup routines, ASPX and MVC views are compiled JIT or Just In Time when the page is actually requested, unless the application built with the pre-compiled flag. –  Brent Pabst Sep 17 '12 at 20:07
add comment

It could be that the application pool has been idle. You can change the idle time out the setting to 0 (zero) which effectively disables the timeout so that the application pool will never shut down due to being idle. You can find this setting in gui under advanced settings. See this blog post: http://brad.kingsleyblog.com/IIS7-Application-Pool-Idle-Time-out-Settings. You can also use a tool like smartping ( I have not used id) http://forums.smartertools.com/showthread.php/8511-SmarterPing-Website-Keep-Alive-Utility. Also there a new module from Microsoft that works with IIS7.5 http://www.iis.net/downloads/microsoft/application-initialization info here http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-application-initialization#TOC301259898

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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