Slow Page Loads

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
I installed nopcommerce on my server, and for some reason, page loads are dragging on a lot longer than they do on nopcommerce demo stores.

I have it running on a Windows 2003 server, IIS, with the latest version of ASP.net running. I have an SQL 2005 server running on a separate box (same local network) and this serves as the database backend for my installation.

Pages are taking 3-5 seconds to come back which is a real problem. I'm running a lot of custom coldfusion apps on the servers and each of those renders pages in less than half a second so it's not a connection issue, slow host, etc...

Any ideas on this one? I would greatly appreciate any help I can get! nopCommerce is the best shopping cart solution I've come across so far. I don't want to have to pass it by due to an issue like this.

Thank you all.
13 years ago
I have found that this happens for me too but only when I have not visited the website for awhile.  Do you get the same performance when navigating through your website or just when you initially visit it?  When NopCommerce starts, the Global.asax file initializes tasks and that could be what you are experiencing.  Also, the initial visit will cause NopCommerce to download a lot of information from the database server and it stores this information in a cache.
13 years ago
I've done a lot of poking around online and I see a lot of people mention that it only happens on the first page load, however it happens on every page load for me. The first page is just as slow as the second which is just as slow as the third, and so on. My page loads aren't a couple hours apart so that it would time-our or anything like that either. I got through 3-4 pages in a minute and they are all just as slow.

I'm not really an ASP person (much more familiar with coldfusion) so I'm not sure if there is something obvious that I am missing? I used the microsoft web platform installer to setup the site so I just assumed it would take care of all the important settings for me.
13 years ago
I am just loading the products onto my new nopcommerce website and I am extremely concerned that the pages are taking far too long to accept each upload. In some cases I am experiencing up to 15 minutes!!! to move from one page to the other or to upload . Surely this cannot be right.!
13 years ago
What is actually happening is that your site is being compiled after the ASP.NET worker process has restarted anytime there is a lack of activity on your site. 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 have to compile your entire nopCommerce site all over again.

To prevent this, a web request has to be made to one of your pages at MAX every 19 minutes. I recommend that folks take advantage of the built-in keep-alive function in nopCommerce. NopCommerce already has a keepalive Ping page set up in your file system.

For Windows (IIS) Shared Hosting on Godaddy:

1. Register for a free web cron job, try http://www.setcronjob.com or http://www.keepaliveforever.com.
2. Create a new cron job to hit the following page of your site:  http://www.yoursite.com/KeepAlive/Ping.ashx every 10 or 15 minutes


This ping should prevent the ASP.NET worker process from shutting down and having to recompile every time there is a lack of activity on your site.
13 years ago
ericsolan,

Thank you very much for your suggestion on how to keep the nopCommerce solution running between visits.

So far, setcronjob.com seems to be working great!

Thanks again.
13 years ago
I have just gone live with my first NopCommerce 1.80 site. Customer has 13000 products with 30000 variants.

I had the same problem, it was definitely not related to keep alive.

I was getting 20 or 30% CPU usage (and slow response - taking 20 seconds to load the product details page in the public site), on my 4 CPU Windows 2008 server on the web. Now its less than 1s and hardly anything on the CPU.

It appears that there are some big big problems with indexing.

For example, Nop_ProductPicture is a cross reference table with foreign keys relating to ProductID and PictureID, but there are is only one index defined, that for the pk!

It is necessary to define an index to support each individual fk on large tables. This should not be that important due to some caching of pictures but theres much more, most tables in the database are only partly indexed.

Other tables such as Nop_Product_Category_Mapping and Nop_Product_Manufacturer_Mapping have big problems.

Let me take Nop_Product_Category_Mapping. There is an index - IX_Nop_Product_Category_Mapping that contains ProductID and CategoryID, however this does not support the FK's on the table. Ideally you should have a separate index on each FK. So I have added two more indexes one for ProductID the second for CategoryID.

This is necessary because if you go one way, e.g.
SELECT * FROM Nop_Product_Category_Mapping pcm
INNER JOIN Nop_Product p ON p.ProductID=pcm.ProductID
INNER JOIN Nop_Category c ON c.CategoryID=pcm.CategoryID
WHERE p.ProductID=123

This uses one of the indexes while
SELECT * FROM Nop_Product_Category_Mapping pcm
INNER JOIN Nop_Product p ON p.ProductID=pcm.ProductID
INNER JOIN Nop_Category c ON c.CategoryID=pcm.CategoryID
WHERE c.CategoryID=456

uses the other.

I believe this is technically because if you have an index

ProductID, CategoryID

This cannot work for
WHERE CategoryID=456

only for

WHERE ProductID=123 and CategoryID=456

and maybe

WHERE ProductID=123 - but the SQL tools are telling me to add an individual index also and the results appear to confirm this - in the past if I had

ProductID, CategoryID

I would just add one new Index on CategoryID because in theory the original index could be used for ProductID only queries.

I have modified a dozen of the product related tables in my database just now.

This is backed up by both the improvement in performance in long running queries - 1000% better in some cases and also by examining queries in SQL/Server 2008 Performance Tuning Advisor and also SET STATISTICS XML ON and looking for missing indexes in the SQL, which I did to technically prove the above before making any changes - what I have just said about indexing is true for Oracle database so I was careful to check before using it on SQL/Server.

I intend to review the entire database tomorrow and put individual indexes on all FK's if the table concerned has more than 500 rows. This will sort this particular problem once and for all.

I hope this helps somebody.

Please accept my apologies if I have posted this in the wrong place. This is my first ever post...

Regards

Philip
13 years ago
Thanks for the info.

If possible, when all is working; I would like to know which modifications you made.

Could you install xSQL (its free) and > Script the schema. This way I can compare your mods.
13 years ago
For sure I will do it, please give me a day or so to get around to doing it...

The work I have done so far has absolutely transformed the site - product detail page load times from 5-10s or more down to, well if you would like to see for yourself go to http://www.bgpaynecrafts.co.uk
13 years ago
Im sorry to say your details page is still slow. 13-17 seconds.

The category pages are ok. What does the SQL profiler what taking so long?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.