Preventing Site Loading Delays due to ASP.NET Startup (Including DotNetNuke) 

Reducing the delay time upon first requests to a DotNetNuke or other ASP.NET website is something that I see asked quite often.  This delay is due to the ASP.NET Worker Process compling a website, this articles will discuss the solutions available to prevent this delay from occuring.   I personally find that the simplest solution is the best; the even better part is that it is free! First of all before I talk about the different solutions available let me first explain the issue and why it happens.

Depending on your specific setup and hosting environment this initial load time can be quite lengthy. I have noticed initial load times of anywhere from 4-5 seconds to over 25 depending on the server configuration and load. What is actually happening is that your DNN site is being compiled after the ASP.NET worker process has restarted. The worker process can restart for many reasons, however the most troubling one is due to site traffic. By default IIS will shut down the ASP.NET worker process after 20 minutes of inactivity meaning that the next request will restart the worker process and cause the compilation to occur.

Solutions

Now there are many different solutions to this issue I have recently noticed 4 distinct common recommendations. The first recommendation is a very simple fix, however, for those of us in shared hosting environments we cannot perform the needed changes. If you have access to administer IIS you can change the recycling properties of the ASP.NET worker process for your specific application pool. I have heard of many users changing the value from 20 minutes to be 6-8 hours to ensure that the process does not end until extreme cases of inactivity.

The second method to resolve this issue is the one that I personally use for all of my websites DotnetNuke or ASP.NET. This method relies on using an external service to “request” a page of your site every __ minute. DotNetNuke even provides a .aspx page that you can use for this purpose to limit the bandwidth used by these “keep alive” processes; keepalive.aspx. http://www.host-tracker.com provides a free service to monitor your website the added benefit is that they will track your overall site uptime as well. I use them for this website and they are directed to http://www.mitchelsellers.com/keepalive.aspx for monitoring. This should do a good job to keep your site active as long as the monitoring location sends requests every 10-15 minutes.

The other two options are site isolated elements that I have not yet tested and these involve placing various pieces of code into your application to have it call itself just before the worker process is shutdown. This can be done via an HTTP Module or via the ASP.NET Website Heartbeat event monitoring. I personally have not used these methods as I do not want to modify the DNN core, or the core of any of my ASP.NET applications. However, if you search for these topics online you will find many examples.

Conclusion

I hope this has provided some helpful information regarding the delays experienced when requesting the first page for an ASP.NET website.

Posted by Mitchel on Wednesday, June 13, 2007
 

Comments

Hi Mitchel,

The hosttracker url takes me to some sort of aggregate search page. Also, are you sure this service is free? I thought i had aleady been there and signed up only to find out after I got throught the signup process that my account was only free for 30 days. I was then offered pay choices to continue to use the service. Maybe I missed something. Thanks for the tips here though. I have access to my web server. Where exacxtly do I change the time value for the worker process for install? Is there any downside to this?

Thanks,

Paul

By Paul Sellers on Thursday, June 14, 2007 at 11:10 AM

Paul,

I am incredibly sorry, I had the wrong link up there for Host Tracker, the URL was supposed to be http://www.host-tracker.com I have updated the article.

They are fee and as far as I know have no plans of changing. I have my free account and Ihave been using it for well over 1.5 years.

By mitchel.sellers@gmail.com on Thursday, June 14, 2007 at 11:24 AM

The solution you post, which must be the most commonly used actually does not improve the application startup. As it is aimed at not letting it shutdown. In that sense the Blog post is somewhat misleading. You migh want to change it. On the other hand I find your posts very helpful in general. Thanks for taking the time to share your knowledge.

By hooligannes on Thursday, June 14, 2007 at 3:19 PM

You are 100% correct, I have modified the article to note the differentiation as I can easily see how this could be mis-understood.

By mitchel.sellers@gmail.com on Thursday, June 14, 2007 at 4:07 PM

I'm using Host-Tracker for a long time. But it directed to my home page. Should i change it to keepalive.aspx subpage?

By Ismet Dumlupinar on Saturday, June 16, 2007 at 3:17 AM

Either works, I use the keep alive page because it uses less bandwidth, but you can actually use any page on the site.

By mitchel.sellers@gmail.com on Saturday, June 16, 2007 at 7:16 AM

Guys,

Host-Tracker.com does have a free service, but you should strongly consider getting the affordable paid service.

In addition to getting the benefits of "keep alive," you'll also know right away whenever there's a problem with your site.

This is quite important when your site is making money for you -- but only when it's up! :)

HTH,

--Bruce

By bonder on Thursday, June 21, 2007 at 11:03 PM

I bought KeeperUp from snowcovered. While it's super basic, it costs $10 and you can define any number of urls to hit. It's a desktop app and works pefectly. It also sends out an email (you'll specify your pop3 settings) in case of failure and, then, it'll send you another one, once it is successful. Very useful.

By vitkoz on Saturday, June 23, 2007 at 6:21 PM

Just signed up with host-tracker.com. Looks like it's free but after 30 days its 30 minutes intervals. Does that mean there is a 10 minute window every half hour that the site can take a long time to load if a user comes during that 10 minute window period?

By Python on Wednesday, August 01, 2007 at 7:48 AM

They must have changed their policies....

By mitchel.sellers@gmail.com on Wednesday, August 01, 2007 at 1:41 PM

do you know or any code sample that can do Preventing Site Loading Delays due to ASP.NET Startup (vb.net)? BTW, your site is very helpful for me.

By Michael on Saturday, October 06, 2007 at 7:30 AM

Michael,

I do not know of any code samples, however, I know it can be done with an HttpModule..

By mitchel.sellers@gmail.com on Sunday, October 07, 2007 at 6:08 PM

Does it really work?
i was worried and i even changed my hosting but din't seem to help me. DNN has some intensive issues sometimes too specially installation, configuration and performance. Not all the times but i dont have much time to research on dnn to check whats wrong and who has? (no one)

i was thinking to make a keep alive service on my dedicated server(another than the dnn installation server), But again no time.

Anyhow i have signed up and see if they work.

Thanx anyhow (for free solution specially ;D)

By Asif Ashraf on Wednesday, March 19, 2008 at 11:06 PM

Does it really work?
i was worried and i even changed my hosting but din't seem to help me. DNN has some intensive issues sometimes too specially installation, configuration and performance. Not all the times but i dont have much time to research on dnn to check whats wrong and who has? (no one)

i was thinking to make a keep alive service on my dedicated server(another than the dnn installation server), But again no time.

Anyhow i have signed up and see if they work.

Thanx anyhow (for free solution specially ;D)

Asif Ashraf
MCAD.NET, MCP
ASP.NET Team Lead,
Store Secured Inc.
http://storesecured.com

By Asif Ashraf on Wednesday, March 19, 2008 at 11:07 PM

sorry for double posting, i forgot the signature in the first.

remove first if you like.(and also this last one)
thanx

By Asif Ashraf on Wednesday, March 19, 2008 at 11:08 PM

Very nice article, I implemented your first fix.

By Michael L on Monday, December 01, 2008 at 3:19 AM

Apparently the host-tracker service cannot be used for free anymore for this purpose.

See
http://host-tracker.com/order-page/

The free option has an update interval of at least 30 minutes, not frequent enough to keep a shared hosting website alive.

By Mark J. on Tuesday, July 14, 2009 at 11:14 AM

I do have a new low cost source for this, www.mywebkeepalive.com, it is a service provided by my company IowaComputerGurus.

By mitchel.sellers@gmail.com on Tuesday, July 14, 2009 at 11:44 AM

Thanks for the post.
it helped me to resolve init load issue.

Ashish
http://ashishkhandelwal.arkutil.com

By Ashish on Thursday, November 12, 2009 at 3:41 AM

Why not have a simple website to do it on your local computer somewhere?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="20" />
<title>The Pinger</title>


</head>
<body>


</body>
</html>

By Dusan on Saturday, November 28, 2009 at 2:46 AM

DNN Monitor is Free DotNetNuke Keep Alive Service! Visit www.dnnmonitor.com to sign up for your account today.

By Mandeep Singh on Monday, January 04, 2010 at 1:01 PM

Thank you very much Mandeeps!

Also a big thanks to Mitchel for an excellent and resourceful website.

By Lord Alberon on Wednesday, January 06, 2010 at 4:16 AM

Hi there,

I've just set up a free site to keep alive DNN sites. It hits your sites every 2 minutes and logs the response times. It shows detailed graphs and alerts you when things go bad.

It's at http://www.pingalive.com

If you have any suggestions or problems contact me via the site.

By David on Friday, May 21, 2010 at 11:07 AM

This was driving me crazy. Thanks SOOOO much for explaining it and offering solutions. I will use one of the 3 services and all sites that I create from now on.

By Rhonda on Tuesday, May 25, 2010 at 6:24 AM
Click here to post a comment

Disclaimer