Slow Page Loads

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
I had some very slow pages. 10-20 seconds on the categorypages.  I have tried all suggestions here and in other threads but finally I found an own solution of the slow pageloads.

My problem was that my customer wanted the possibility to zoom pictures on the productpage. And since I use 1.8 I store all pics in the database... This means that the table Nop_Picture will be huge (picturebinary), and I found out that for every picture on the categorypage, NopCommerce loads one row from Nop_Picture, only to get its Url. The productpage imagefile is 3000x2400px (which is stored as binary in Nop_Picture)  but category uses only 318x225...

After making an update, my pages now loads in 1-2 seconds, a huge improvement and my customer is happy :)
13 years ago
I'm running http://www.podpeopledesigns.com.au/ on studiocoast a brisbane based host.. their service has been awesome.

my problem is I've made the changes as above, added the indexes.. changed ProductService and the other changes as described and turned off storing images in the DB and alas still taking anywhere between 3-10 seconds to load the categories from the side menu there.. especially earrings and rings

does anyone have anything they could suggest? is it time to start looking for a vps or dedicated host?

I only have 24 products in the earrings category yet it's still taking that amount of time

Cheers,
Tom
13 years ago
I have a problem with this as well. www.hvtmerch.com. Everytime they post a special to their twitter or facebook page the site slows down quite a bit. Up to 15-25 second load times which is of course way too long. It is shared hosting with discountasp.net right now. under general use it seems fine. I need to tune the site and was wondering who all has had success with the mentioned indexes. I need to solve the issue but do nto want to cause any issues either. I assume no harm in adding the indexes? I think the host is pretty good but maybe I also need to take it dedicated? Any other ideas would be appreciated. I woudl love to have it all ready for their next roudn of specials.
13 years ago
The CategoryNavigation control takes a while to load as it loads all products down the tree for each category displayed to show the number of products next to the name.

If you go to

~/administration/GlobalSettings.aspx?TabID=pnlProducts

and turn off

"Show the number of distinct products besides each category"

you should see some improvement in page loads.

Even with this off, however, it still takes a relatively large amount of time during preRender for this control.  My advice would be to either switch to static links for category navigation, or rely on caching of the controls content output.  I plan on doing the latter myself.
13 years ago
Thanks so much for the hint re category nav..
but that option was already off for me..

Cheers,
Tom
13 years ago
Concoxide, you mention "or rely on caching of the controls content output." Could you please describe in brief how this is done, so that I can try it/
Thanks you in advance,
13 years ago
knellas wrote:
Concoxide, you mention "or rely on caching of the controls content output." Could you please describe in brief how this is done, so that I can try it/
Thanks you in advance,


Well, if your categories always display the same list on every page, you could simply add the following to the top of CategoryNavigation.ascx

<%@ OutputCache Duration="86400" Shared="true" VaryByParam="none" %>

That will cache the output of the control on the server for 86,400 seconds, or 1 day at a time.  However, there are some drawbacks to this simple form of caching.  If you were to change, add, or delete a category, the pages will not reflect the update until the following day.  The first time it is loaded by anyone while that directive is on the control, that is the content that will be loaded for everyone, on every page for the following 24 hours.

There are other ways to do this even better but much more complicated and requires more backend coding and maybe even another table in your database.  If you display different categories based on what page you are on, then you would want to cache each different output with its own id using Page.Cache.  You could set a dependency so that if you update a category, it would automatically invalidate the cache so a new one could be created.  It could take some extensive restructuring of the category navigation control as well as other management areas of the application to make this work well . . but the actual caching and retrieving part would look something like this.

string strCacheID = "myCacheID";
if (Page.Cache.Get(strCacheID) == null)
{
    string strCacheDependencyFile = Path.Combine(Request.PhysicalApplicationPath, "myCacheDependency.txt");
    string strCacheContent = BuildOutput();
    Page.Cache.Add(strCacheID, strCacheContent, new System.Web.Caching.CacheDependency(strCacheDependencyFile), System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.AboveNormal, new System.Web.Caching.CacheItemRemovedCallback(RemoveCallback));
}
divCategories.InnerHtml = Cache.Get(strCacheID).ToString();


with this, you would have a file "myCacheDependency.txt" that could have a 0 or a 1 in it.  And whenever you want the cache to reset, switch it in the file.  This can be done programmatically, such as in the code where categories are updated.   The code also is set to call the subroutine RemoveCallback when the cache is reset, which you will write yourself and you can rebuild the cache within it like so

void RemoveCallback(string tag, object obj, System.Web.Caching.CacheItemRemovedReason reason)
{
    string strCacheDependencyFile = Path.Combine(Request.PhysicalApplicationPath, "myCacheDependency.txt");
    string strCacheContent = BuildOutput();
    Page.Cache.Add(tag, strCacheContent, new System.Web.Caching.CacheDependency(strCacheDependencyFile), System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.AboveNormal, new System.Web.Caching.CacheItemRemovedCallback(RemoveCallback));
}


There is much more that goes into this that i cannot go into in one post.  But you should get the picture, get creative :)
13 years ago
Does anyone know whether the performance issues have been resolved in 1.9?
I have just loaded about 12,000 products and the entire site has become very sluggish. I note jdsupport has done some investigation and discovered poor indexing and wondered whether this has been fixed in the current version or if anyone has any advice on optimising the site or server to deal with this.
12 years ago
Hi guys,

We use nop 1.9 version and our website is http://www.mark-ha.com

Everthing is fine but product details page.

Product details page opens soo slow (takes about 8 - 12 seconds to open)

For example category pages;

http://www.mark-ha.com/2014-mayo-modelleri-2014-bikini-modelleri

opens fast enough.

But the product pages;

http://www.mark-ha.com/kom-jerom-sortlu-elbise-mayo

takes 8 - 12 seconds to open.

Every single category or manufacturer pages works quiet fast. Only the product details pages dont work well

If i shut the sql for 1 minute and re open again, everything works well but in couple of minutes it goes slow again.

This slow opening effect our cpu usage too. We consider that something wrong with the sql. perhaps sql connection is not closing or what so ever.

As we are running an e-business website (12000 products selling online) this speed issue effects our sales very badly and we need to solve this problem as soon as possible. We need any advice terribly.

Please do not hesitate to ask about more details.  

Thank you in advance,

Ali Caliskan
12 years ago
Hi boozey, i am dealing with the nop 1.9. performance issues now. I have checked out your web site and it is really fast. Would you share your experience, i.e. what did you have to fix to gain such significant performance improvement?

Thank you,

Norbert
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.