Slow Initial Site Load
-
- Lieutenant (LT)
- Posts: 79
- Joined: Thu Oct 04, 2007 9:23 am
- Location: West Hartford, CT
- Contact:
Slow Initial Site Load
It takes my site up to 20 seconds to load the first time I hit it after the site is not used for a while.
Is this due to a recompilation, caching? I would hate to use a ping site to keep this thing up and running and that first hit after a period of no use is gonna make my customer a bit gun shy.
What techniques should I use to keep this site up and running so that when you hit it is fast!
FYI - this is a hosted site and I do NOT have IIS admin permissions etc. I could perhaps ask them to change the app pool settings for this site
Also - I have NO products loaded
SQL Server 2005
Any suggestions or help would be appreciated.
Is this due to a recompilation, caching? I would hate to use a ping site to keep this thing up and running and that first hit after a period of no use is gonna make my customer a bit gun shy.
What techniques should I use to keep this site up and running so that when you hit it is fast!
FYI - this is a hosted site and I do NOT have IIS admin permissions etc. I could perhaps ask them to change the app pool settings for this site
Also - I have NO products loaded
SQL Server 2005
Any suggestions or help would be appreciated.
- NC Software
- AbleCommerce Partner
- Posts: 4620
- Joined: Mon Sep 13, 2004 6:06 pm
- Contact:
I would not suggest pre-compiling your site. It is normal if your site gets no activity for it to delay as you are seeing. If your site is not getting any activity, it's probably a moot point, but if you want to keep your site "alive" then you would have to use a ping utility such as:
http://www.smartertools.com/forums/t/14404.aspx
http://www.smartertools.com/forums/t/14404.aspx
Neal Culiner
NC Software, Inc.
NC Software, Inc.
Pinging would solve it but it's only addressing the symptom. Increasing your app pool expiration is the real solution.
Is your site hosted on a shared provider? I tried running AC7 on Discountasp.Net sharing hosting and performance was horrible. 30 secs to bring the first page, 8-10 seconds between pages.
I ended up buying my own server (Proliant DL360) on Ebay for under a grand. First load is less than 5 seconds and subsequent pages snap almost instantly.
I'm sure bandwidth had something to do with my initial performance issues, but not all of it.
Is your site hosted on a shared provider? I tried running AC7 on Discountasp.Net sharing hosting and performance was horrible. 30 secs to bring the first page, 8-10 seconds between pages.
I ended up buying my own server (Proliant DL360) on Ebay for under a grand. First load is less than 5 seconds and subsequent pages snap almost instantly.
I'm sure bandwidth had something to do with my initial performance issues, but not all of it.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
- NC Software
- AbleCommerce Partner
- Posts: 4620
- Joined: Mon Sep 13, 2004 6:06 pm
- Contact:
I do not recommend changing the AppPool, you are not fixing the problem. The problem you need to fix is your lack of traffic. Pinging should not be required, and as I stated, if no one is coming to your site, it's a moot point, you are simply causing the server to work needlessly. Get AC7 in production, work hard on SEO, get some advertising out there, etc. and all problems will be solved.
On a side note, I've heard good reviews of DiscountASP.net and I recommend them. You may have had some bad luck in having a bad neighbor which could have been solved by asking to be moved, etc. Dedicated/owned is always the way to go if/when you can afford it. Ultimately, colocation - buy your own servers, pay for rack space, enjoy the comforts of ownership and not sharing with unknowns!
On a side note, I've heard good reviews of DiscountASP.net and I recommend them. You may have had some bad luck in having a bad neighbor which could have been solved by asking to be moved, etc. Dedicated/owned is always the way to go if/when you can afford it. Ultimately, colocation - buy your own servers, pay for rack space, enjoy the comforts of ownership and not sharing with unknowns!
Neal Culiner
NC Software, Inc.
NC Software, Inc.
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Pinging is a suitable solution if you do not have the ability to modify the app pool settings. I had toyed with including an automatic keep alive in this version, but opted not to. (It is possible that future feature enhancements may require us to keep the application alive during periods of non-activity.)
Cheers,
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Logan

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
-
- Lieutenant (LT)
- Posts: 79
- Joined: Thu Oct 04, 2007 9:23 am
- Location: West Hartford, CT
- Contact:
Well as it turns out pinging (in a really healthy scenario) might actually work - but in this case I ended up just getting an application_start being logged every time the site got pinged.
My ISP tells me that the app pool this application is running under has no time out.
They just recently (today) put the site in its own app pool so we will see where this goes. They are also going to monitor the shared server to see if any other site is the culprit (with my luck it will probably be one of my changes to a custom conlib file
)
Anyways... I will keep you posted on my progress.
My ISP tells me that the app pool this application is running under has no time out.
They just recently (today) put the site in its own app pool so we will see where this goes. They are also going to monitor the shared server to see if any other site is the culprit (with my luck it will probably be one of my changes to a custom conlib file

Anyways... I will keep you posted on my progress.
-
- Lieutenant (LT)
- Posts: 79
- Joined: Thu Oct 04, 2007 9:23 am
- Location: West Hartford, CT
- Contact:
One more thing.... I am now logging (via global.asax) all application events so we will see what this yields - see the code below. If anyone sees a problem with what I have posted here holler!
Note: My file permissions are set so that the ASPNET user has write access to the /app_data folder - this solution does not work unless you have permissions set this way on your installation
Use this at your own risk.
BACK UP YOUR ORIGINAL VERSION OF GLOBAL.ASAX BEFORE USING THIS CODE!!!
Note: My file permissions are set so that the ASPNET user has write access to the /app_data folder - this solution does not work unless you have permissions set this way on your installation
Use this at your own risk.
BACK UP YOUR ORIGINAL VERSION OF GLOBAL.ASAX BEFORE USING THIS CODE!!!
Code: Select all
@ Application Classname="AcApp" Language="C#"
@ Import namespace="System.Diagnostics"
@ Import namespace="System.Reflection"
@ Import namespace="CommerceBuilder.Utility"
<script>
protected void Application_BeginRequest(object sender, EventArgs e)
{
//NO TASKS
}
protected void Session_OnStart()
{
//SAVE THE REFERRER FOR USE BY THE ORDER MODULE
if (Request.UrlReferrer != null) Session["SessionReferrerUrl"] = Request.UrlReferrer.ToString();
}
protected void Application_Start(object sender, EventArgs e)
{
CommerceBuilder.Utility.Logger.Info("App Started: " + DateTime.Now.ToString());
}
protected void Application_Error(object sender, EventArgs e)
{
CommerceBuilder.Utility.Logger.Error("App Error:", Server.GetLastError().GetBaseException());
Server.ClearError();
}
protected void Application_End(object sender, EventArgs e)
{
CommerceBuilder.Utility.Logger.Info("App Ended: " + DateTime.Now.ToString());
//try
//{
// HttpRuntime runtime =
// (HttpRuntime)typeof(System.Web.HttpRuntime).InvokeMember("_theRuntime",
// BindingFlags.NonPublic
// | BindingFlags.Static
// | BindingFlags.GetField,
// null,
// null,
// null);
// if (runtime == null)
// {
// CommerceBuilder.Utility.Logger.Info("Shutting down - runtime is null");
// return;
// }
// string shutDownMessage =
// (string)runtime.GetType().InvokeMember("_shutDownMessage",
// BindingFlags.NonPublic
// | BindingFlags.Instance
// | BindingFlags.GetField,
// null,
// runtime,
// null);
// string shutDownStack =
// (string)runtime.GetType().InvokeMember("_shutDownStack",
// BindingFlags.NonPublic
// | BindingFlags.Instance
// | BindingFlags.GetField,
// null,
// runtime,
// null);
// try
// {
// CommerceBuilder.Utility.Logger.Info("App Ended: " + shutDownMessage + ": " + shutDownStack);
// }
// catch (Exception ex)
// {
// CommerceBuilder.Utility.Logger.Info("App Ended", ex);
// }
//}
//catch (Exception ex)
//{
// CommerceBuilder.Utility.Logger.Info("App Ended", ex);
//}
}
</script>
Last edited by drollins on Thu Dec 06, 2007 4:24 am, edited 2 times in total.
-
- Lieutenant (LT)
- Posts: 79
- Joined: Thu Oct 04, 2007 9:23 am
- Location: West Hartford, CT
- Contact:
One more note.....
You do need permissions to make private reflection calls (which I believe can be turned off via code-access security) -- so that might be an issue depending upon how your security is setup on your ISP
See this article for more info: http://weblogs.asp.net/scottgu/archive/ ... 33194.aspx
You do need permissions to make private reflection calls (which I believe can be turned off via code-access security) -- so that might be an issue depending upon how your security is setup on your ISP
See this article for more info: http://weblogs.asp.net/scottgu/archive/ ... 33194.aspx
-
- Lieutenant (LT)
- Posts: 79
- Joined: Thu Oct 04, 2007 9:23 am
- Location: West Hartford, CT
- Contact:
So...... using this code I've posted I found out that my site was being idled by IIS after 20 min even after they turned off the idle time out on the app pool I was running under.
There seems to be a bug with IIS so....
My isp then explicitly configured the element hostingEnvironment for my website and set idleTimeout to Infinite ... this seemed to to the trick.
My site now is up and running 24/7 always loaded always ready ...
I can now sleep at night ...
There seems to be a bug with IIS so....
My isp then explicitly configured the element hostingEnvironment for my website and set idleTimeout to Infinite ... this seemed to to the trick.
My site now is up and running 24/7 always loaded always ready ...
I can now sleep at night ...