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:
CE : Community Edition / EE : Enterprise Edition
- 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:
- 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:
- Similarly, for sessions:
- <timeout>3</timeout> <!– 2.5 can lead to problems –>
- Approve all store caches, and use Redis’s cache backend.
- 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.
- If 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).
- Use FPM
- Split your BO/FO/Order tunnels via SSL
- 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