For an e-commerce website, performance is a major lever to increase the conversion rate and thus, ultimately, the sales and the turnover. NBS System, first Magento Entreprise Edition hosting provider in France, gives you advice on how to optimize your Magento website.

Optimization through PHP

  • Migrate to the latest versions of PHP, at least PHP 5.6.
  • Use PHP FPM (FastCGI Process Manager) rather than Mod PHP : (18% increase in performance). We advise you a 3 tiers architecture, for a better function separation (view, logic, data), stability and resource use. This configuration also facilitates troubleshooting, and gives you the opportunity to prioritize and boost some layers according to your needs.

Check here what versions are available for your Magento version:

Captureversions

CE : Community Edition / EE : Enterprise Edition

Database optimization

  • There again, migrate to the 5.6 version of MySQL. It represents a 17% increase in performance compared to the 5.5 version!
  • Use Percona. It it a very efficient opensource software for the optimization of database performances. We recorded an increase in performance of about 20%, without changing a thing about the database’s organization or the admin’s treatment method!
  • Split your tables. When you do, it is easier to customize their parameters! It also allows to split “read” and “write”, as well as the requests, which can no longer block eachother. It will bring more granularity to your website as well.
  • Clean your database regularly and defragment it:DB SQL
  • Configurate all indexes to manual mode in order not to overload your frontend every time you change a product
  • Allow the use of “flat catalog” to stop using the EAV model (Entity – Attribute – Value), which is criticized a lot for decreasing performance.

Optimization through caching

  • Use the following parameters:
    • <slow_backend_store_data>0</slow_backend_store_data>
    • <auto_refresh_fast_cache>0</auto_refresh_fast_cache>
    • <compress_data>0</compress_data>
    • <compress_tags>0</compress_tags>
    • <lifetimelimit>86400</lifetimelimit>
  • Similarly, for sessions:
    • <timeout>3</timeout> <!– 2.5 can lead to problems –>
    • <max_concurrency>10</max_concurrency>
  • Approve all store caches, and use Redis’s cache backend.

Code optimization

  • Limit the complexity of your CSS and JavaScript code: lighter files are quicker to load. Do not merge them with Magento’s default function either: it is theorically a best practive, but often decreases your Magento website’s performance. You can, though, divide your requests into groups (global requests / specific requests, for instance per page type, such as product pages or checkout)
  • Beware of plugins. Most of the proposed plugins are not tested by Magento, and are often ill-coded or ill-optimized. Moreover, if you use too much, it will slow down your whole website.
  • MagentoIf you create your own plugins, keep the following advice in mind:
    • Your additional blocks will not be recognized by Magento’s cache
    • Avoid infinite “natural join” requests
    • Monitor your website before and after adding your code, in order to meadure its impact
    • Do not ever, EVER, touch the core
  • Your templates must remain simple.
    • Do not overload them with useless functionalities, or with too many add-ons or gadgets (social media, tracking tools… keep it simple)
    • Keep an ergonomic and easy-to-read design
    • Use Ajax and avoid coding errors
  • Adapt the size of your images
  • Avoid all information that could deactivate Varnish or FPC

A few additional, loose ideas

  • Adopt the “one server, one role” method
    • Cache: split Redis instances, and even Redis’s databases if you can (particularly if you own a multi-store website).
    • PHP:
      • Use FPM
      • Split your BO/FO/Order tunnels via SSL
    • Database:
      • Split “read” from “write”
      • Isolate the most requested tables in a specific instance
  • Parameterize the maximal depth of your navigation to 1 or 2. If you keep the default value of 0, your frontend will load the full structure with every page.
  • Find a balance between the number of exposed products on each page and the corresponding loading time. Do not forget to deactivate the “allow all products per page” parameter…
  • Deactivate the Magento Profiler, it could make you save up to 2 seconds on the total loading time.
  • Find your 404 erros and treat them: each 404 element adds about 80ms of loading time…
  • Use PageSpeed, an optimization tool.

This information comes from:

  • « Magento Performances – best practices 2015 », a presentation by Philippe Humeau, CEO of NBS System. It was presented to the Bargento 2015, on October 13th, 2015
  • Sonassi’s blog
Lucie Saunois
Lucie Saunois
IT aficionado, specifically when it comes to cybersecurity, since she joined OT Group in 2015, Lucie specializes in making technical, and often complex, topics understandable by anyone.