How to improve performance for NopCommerce 3.0

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
Hello, I am using NopCommerce 3.0 and I am getting terrible performace and I wanted to see if there was a way to improve performance. I am currently using Arvixe as my host, we have been having an issue with the js bundling so we are looking at disabling this feature as javascript is not always being loaded and when looking at the bundles sometimes it comes back as page not found. With plugins relying on the jquery files, this has to be loaded every time the site loads. Currently the site load from start to finish takes about 2 minutes to complete the load time, I am reaching out as this is a long long time to wait and want to see how can we improve the performance of the site that we are developing. I have also tried this on my local machine via localhost and I am getting the same issues...

Thanks!
10 years ago
Hi,  Can you share your site URL, so we can review? Moreover, are you referring to a long waiting time (time to first byte) or a loading time?

Regards,
nopAccelerate.com
10 years ago
The testing site is here, http://www.centerfortheperson.org.camellia.arvixe.com/
There are some features such as an image rotator as the host has not yet disabled the js bundles so the javascript and jquery are not being loaded as of yet...

I just ran a test on pingdom.com and it came back with 41 requests and load time of 41.76s and noticed that the bundles js is working for the moment, which 95% of the time is not the case

Thanks
10 years ago
I have performed four tests using WebPageTest and except the one test, all test results show your page is slow to load.

http://www.webpagetest.org/result/130704_35_11FW/
http://www.webpagetest.org/result/130704_KJ_11DT/
http://www.webpagetest.org/result/130704_8T_11QK/
http://www.webpagetest.org/result/130704_E7_11QT/

This may be because of some other factor. What is the slowest page in your site?

Moreover, as you already told that you got issues with js bundling.. does disabling it fixes your issues? And do you got any error in error log related to bundling? I also advise to check for file permissions on your nopCommerce folders. However, I see that bundling is working fine in all the tests performed.

The slow site speed I see is due to long waiting time (time to first byte). Try enabling the Mini-profiler to see which method is taking long to execute? Once you find it, you need to cache it. Moreover, make sure your site pool is not recycled very frequently. What is memory and cpu usage of the site? Does it have enough memory? If not, it could be the problem.

I think issue is with the available memory or app pool related, as you can see that only first request is taking too long to load. The repeat view is always faster in all the tests.

Thanks

Krunal

nopAccelerate.com
10 years ago
I figure out an out of the box Solution for Nop speed,

I was a bit angry because everyone i talk to where talking about profiler, query optimisation , weeks of work....

Finally i add an idea to use xml instead of cache and it took 2 day work.

Step 1- I put a trigger that detect change in product db
Step 2- I made a script trigered by step 1 that create one xml for each
category that contains all info: productid, thumbnail (also a bottleneck),
tier prices name english and french etc.. Also the script make 1 xml for
all the categories structures.

yes it mean for my site 100 xml of about 400k each and a few of 2 meg... but for a 2s response time what is an extra 200 megs??? (finally it take 40 meg!)

Step 3- I write in productlist.cshtml and change it to load the roles and
the specify category id xml  and populate the result respecting the roles and
business rules. Since it dont request the db for each product anymore I
improove from 2 min to 7s

Step 4- I rewrite the category menu control to load the xml and populate it
without any request to db except one time to get the roles.

Now any product page load in 2-3 second maximum

Step 5 I implement a button in admin area to run the script anytime I feel
i dont want to wait the trigger.

So the plugin for the script is easy, but I cannot make a general
productlist that would take anytype of business rules like we have. But
still it was a 2 day work and I had a huge improvement.

Another advantage, it is multi-lingual, site, multi-tier price

So i wish it can help.
10 years ago
mtlaffaires wrote:
I figure out an out of the box Solution for Nop speed,

I was a bit angry because everyone i talk to where talking about profiler, query optimisation , weeks of work....

Finally i add an idea to use xml instead of cache and it took 2 day work.

Step 1- I put a trigger that detect change in product db
Step 2- I made a script trigered by step 1 that create one xml for each
category that contains all info: productid, thumbnail (also a bottleneck),
tier prices name english and french etc.. Also the script make 1 xml for
all the categories structures.

yes it mean for my site 100 xml of about 400k each and a few of 2 meg... but for a 2s response time what is an extra 200 megs??? (finally it take 40 meg!)

Step 3- I write in productlist.cshtml and change it to load the roles and
the specify category id xml  and populate the result respecting the roles and
business rules. Since it dont request the db for each product anymore I
improove from 2 min to 7s

Step 4- I rewrite the category menu control to load the xml and populate it
without any request to db except one time to get the roles.

Now any product page load in 2-3 second maximum

Step 5 I implement a button in admin area to run the script anytime I feel
i dont want to wait the trigger.

So the plugin for the script is easy, but I cannot make a general
productlist that would take anytype of business rules like we have. But
still it was a 2 day work and I had a huge improvement.

Another advantage, it is multi-lingual, site, multi-tier price

So i wish it can help.


Just a note that we have tried exact same thing few months back, it works fine during development but when we made it live and run a load testing on the site we realized that it just improves the site performance for certain small number of visitors.. once you start to reach the limit with more visitors / concurrent users the site performance will degrade drastically.. even worse than it was before. Earlier it was SQL server which was taking most resources... after this kind of implementation SQL server was free most of the time, but worker process started to take the most of CPU. We tried with XML and even storing the data in binary format too, which further improved performance.. but is certainly not reliable. With more visitors, you will severely hit with high IO as well.

I recommend you to test it thoroughly with load testing and especially apply some specification and attribute filters on the product list and use it during load testing...and you will soon find the bottlenecks of this implementation. However, this works very well for small sites with low traffic, but not good for busy sites with serious e-commerce business looking for reliable and faster e-commerce site.

If you want quick & reliable solution, then I request you to check our demo store which has more than 80,000 products. Most of the pages are generated and loaded well within a second.. actually it took only 150-250 ms to generate them even if the Solr Core is hosted on a remote server (on our Cloud Solr Server)! So if you host it on your server, then you can save another 100ms!
10 years ago
Yes this is right,

Well there is a few easy solution in that:

1- Put the whole xml in a table. 1 query to the db each time, you can also cache that result.

2- Make a new table that will store all the pre-formatted information  from the script.

3- You can cache the xml from the first call so IO won't be to much concerned. The category that are less popular will stay unload.


Something else we add in the product list is some ajax that push the first part of the page before pushing any product and then pushing the result every 20 products so the user dont wait to see something.

Also the fact that the category menu is almost hard coded save 3s on the first page load.

The idea is to bypass the multiple query.(Nop commerce love query the db always: Looking roles for each product, looking ntier price, counting product per category on each page load, and i didn't talk about discount yet. )

So to do that the best way is to pre-format the data, which i did with the script to xml (Now with your suggestion I will do script to db) it prevent the non-stop called to the db:

That is finish now, 1 category page = 1 query.

I did a test charge, Before with nop 10 user was slowing the site, now i did 500 user in same time no problem.  So I guess putting this in the db will increase it more.

I will post the code when our site is online and some page you can see. We have an option in product per page that is: all product. 2s to be shown and 4s more to ajax load 600 products.

Thank you for the comment it help to explain the solution better.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.