Common Tips, Settings & Recommendations to Optimize Performance in nopCommerce

IIS

Performance is the most painful point where we generally stuck while trying to optimize a website. Since we host nopCommerce on a Windows server and nopCommerce have very rich settings so if configured properly it can be done out of the box. In this article we’ll talk about common things to watch, choose & configure. Also, some best practices improving your nopCommerce website scaling on a hosted environment.

Resources

This is the first point where you can optimize your website performance so you should always go for things that support higher IO such as

  • Disk space
  • Disk type (recommended SSD/flash based disk)
  • RAM (high speed)
  • CPU (an extra CPU for better results)

 

Database (MS SQL SERVER)

SQL

Choosing the right MS SQL SERVER version for your nopCommerce website back-end would be the second and the most important point to consider as many of us really never look into this. MS SQL SERVER comes in different editions, for example, MS SQL SERVER 2016 comes in three different editions as you can see here. You can also see features supported by different versions of MS SQL SERVER 2016 here. We can see that In-Memory OLTP which is transformational in-memory performance is only offered by enterprise version of MS SQL SERVER 2016 as stated here. This makes your MS SQL SERVER responses much faster but it requires careful engineering and proper installation of MS SQL SERVER on your hosting server.

You should also follow some MS SQL SERVER Server best practices as defined below:

  • Always use the latest version, apply patches/fixes and service packs
  • Monitor your MS SQL SERVER and update/add missing indexes
  • Monitor IO, If your latency on Read or Write is consistently over 15-20ms then your IO is slow. Consider upgrading to better storage (SSD, all-flash array or a PCI Fusion IO card)
  • Ensure that your connection string has “MultipleActiveResultSets=True” to allow Entity Framework to make multiple requests to MS SQL SERVER over a single connection, reducing the number of roundtrips
  • Have a replicated server for heavy reporting and avoid running a lot of reporting directly on operational copy of your database
  • Mind the disk space, monitor
    1. Transactional log file growth (proactively track file growth)
    2. Size & free space in a data file (should be pre-sized so they do not have to grow automatically)
    3. Drive space (as a general rule of thumb, it should have at least 10% free space)
    4. Backups (ensure to have regular backups, and your backup drive have enough space to perform backup)
  • Perform regular maintenance routine

 

IIS Performance

IIS plays an important role in your website performance. Here are some common recommendations for your IIS hosting server.

  • Use a dedicated application pool for each website
  • Use 32-bit application pools (not only its compatibility better than the native 64-bit, performance and memory consumption are also better)
  • Configure recycling properly
    1. Idle time-out (minutes): 0
    2. Regular time interval (minutes): 0
    3. Specific times: set to least used time of the day
  • Do not set any memory limit unless troubleshooting specific scenarios
  • Do not use Web Garden until you know what you’re doing
  • Logging
    1. Consider logging only important events on a production machine. You can log everything when debugging
    2. Monitor disk usage as the logs might grow quite fast
    3. Schedule scripts to archive older logs
  • Ensure that ASP debugging is disabled in IIS
  • Use static and dynamic compression (Set Compression Level to 4, and exclude files like JPEG, PDF that are already compressed)
  • Use HTTP expires header

 

nopCommerce Settings

Configuring nopCommerce in a proper way and following the best practices for nopCommerce are always recommended. Moreover, we should always keep the following things in mind:

  • Always use the latest version of nopCommerce
  • Things to ensure when publishing on production server
    1. Ensure that Debug is set to False in web.config
    2. Enable HTTP Compression. Do dynamic and static compression on IIS to reduce your bandwidth on requests (file compression)
    3. Enable Browser Caching. Instruct the browser on how to cache the content, and for how long (setting up expiry headers)
  • Common settings (unused language, stores, currencies, plugins, unused themes)
    1. Understand settings before applying (read hints)
    2. Remove unused languages
    3. Remove unused stores
    4. Remove unused currencies
    5. Remove unused plugins
    6. Remove unused themes
    7. Define WWW prefix, redirections are costly
    8. Enable bundling & minification (JS & CSS)
    9. Load all locale resources on startup. This requires more memory. Not recommended to enable when you have a large catalog or several thousand entities
    10. Load all localized properties on startup. This requires more memory
    11. Load all search engine friendly names on startup. This requires more memory
    12. If not using, enable following settings:
      • Ignore site wide ACL rules
      • Ignore site wide "limit per store" rules
      • Ignore site wide discounts
      • Ignore site wide featured products
      • Cache product prices (only in case if your prices are constant)
    13. If you’re sending email in high volume, use externally hosted Email Servers
    14. If not required then disable store last visited page
  • Media Settings
    1. Keep image size you actual use in your theme
    2. If your catalog is smaller, keep images in the database only
    3. For the large catalog, keep images in the file system rather than storing in the database
    4. Set default image quality wisely
  • Maintenance
    • Delete guest customers at regular interval and their carts using Scheduled Tasks in nopCommerce
    • Delete abandoned carts, if not using (Maintenance under System in nopCommerce admin menu)
    • Delete old exported files (Maintenance under System in nopCommerce admin menu)
    • Enable clear logs using Scheduled Tasks in nopCommerce
    • Monitor logs, fix errors
    • Add missed resource strings
    • Monitor the email queue

 

Other Recommendations

Performance

There are few other things which should also be addressed in order to improve performance in nopCommerce. Configuring or using below mentioned points can be very much useful but few of them depend upon issues that a store owner is facing and scenarios which can be different as per business model of a nopCommerce website.

  • Use CDN to deliver contents faster
  • Use HTTP/2, (If using HTTP/2, then make sure to set Force SSL to True for the all site pages)
  • Ensure your Windows Server is updated & maintained properly
  • Configure antivirus applications to exclude:
    1. Content folders
    2. Temporary ASP.NET files folder (C:\Windows\Framework[64]\vX.X.XXXXX\)
    3. Any temp folders if used
  • Monitoring & fixing processes using unnecessary resources
  • Taking backups in off peak time
  • Ensure your server has enough bandwidth
  • Don’t let your website repeatedly crashed by unexpected traffic. Plan for major traffic spikes to ensure your site can handle the load
  • Simulate peak loads, monitor site responsiveness, and measure application behavior well in advance

 

Above mentioned tips, settings and recommendations can be used for any nopCommerce based store and can also be used for any other website rather than nopCommerce settings to improve performance and scalability of a website on a hosted environment. Since it is very much necessary to understand basics before applying something, we have tried to cover as much as possible. However, at many places in this article we have just mentioned points for sake of understanding because the provided tips are always going to yield results.

If you like reading it and if you gain any benefit from this article then please share your feedback with us because that would encourage us to write our next article in a much fashionable manner. Our next blog would be on “Detecting poor performance issues and how to find bottlenecks in nopCommerce” which would be helpful for our readers to understand when to look for performance optimizations.

This article has been prepared and published by nopAccelerate. nopAcceleratee is a part of Xcellence-IT which is an India based software company. We are offering professional nopCommerce development services to our customers since 2011, helping them to meet their business goals using flexible architecture of nopCommerce. You can find out more about nopAccelerate here and you can also look for our products and services here.

Leave your comment
*

Comments

12/21/2016 1:57 PM
extremely good article, but i would recommend you should also write more specific steps how to do it under each recommendation, or maybe link to a page that explains the process, would be really helpfull.


anyhow, you guys rock, keep it up.
12/23/2016 3:57 AM
Hi @Auto99, Thank you for your feedback. We would write more things about what you expect in our next blog which would be part 2 of this topic.
Please wait for our next blog that would be published in 2nd week of January 2017. Title is mentioned in above article in end.
2/2/2017 2:43 PM
Awesome article! Thank you! As mentioned below would be great to have specific steps for each recommendation.
4/20/2018 11:25 AM
Remove .. means?  delete or disable?
Many thxs.. great article!!
6/12/2018 8:14 AM
I just installed, and did everything as shown in the install guide, but...
Now all images and styling on my WP site are gone...?
12/20/2018 3:48 AM
excellent
8/25/2019 11:35 PM
nice article ... very useful for all e-commerce developer
10/11/2020 2:51 AM
Hi,
I was reading this article because all of my NopCommerce v4.3 instances were running very slow (TTFB of around 10 seconds). They are all running on Azure Web App services.
The one and only setting in this article that really improved TTFB (now less than 1 second) in all websites, was changing the HTTP version to 2.0 (instead of the default v1.1)...

Do you have any updates on this article that is more up to date with the current NopCommerce version (4.3)?