How to ace Magento speed optimization using open source software
Magento is arguably the most popular eCommerce application, but its Achilles heel is performance. Sooner or later every webmaster finds their site to be slow, and look for Magento speed optimization methods.
The natural tendency for most webmasters is to upgrade server resources or buy expensive commercial software. But it’s only a temporary fix. Unless you identify specific bottlenecks, and fix them, you’ll continue to face performance issues.
Bobcares helps eCommerce sites maintain high speed websites. In our web server management services, we keep Magento super fast by using Magento optimized servers and optimizing Magento settings.
Why is Magento so slow?
Magento is popular because it fits the needs of a wide range of businesses. It’s built to be flexible and customizable. Performance was not a core consideration in its design. This caused bottlenecks to form in page rendering, database design etc. Here are the top ones:
- Multiple database queries – For a single page access, Magento has to construct a complex database query that touches multiple tables and rows. Databases reside in server disks, and disks are the slowest component in a server. So, to fix this bottle neck, the disk has to be insanely fast, or clever caching systems need to be enabled.
- Large list of configuration settings – Magento uses a variety of configuration files (system config, layout config, app config, etc.) which requires huge XML trees to be built up in system memory. For each access, these trees are queried, which takes significant CPU time and memory. Unless efficient caching is enabled, these accesses alone can slow the site to a crawl.
- Additional code blocks through customization – Magento’s flexibility comes from its provisions to override default settings, but the downside is that, for each access Magento checks if the needed file sections are overridden at some point. This extra checking adds to the woes.
- Complex templates loading multiple files – To display a single Magento page, multiple template files need to be executed. These files in turn has calls to other PHP files, making a single page display an amalgamation of at least 10 different files. This adds to the resource usage. Proper caching at block and page levels is needed to fix this.
If you thought these were pretty big issues, well, we are just getting started. There are other site maintenance and server infrastructure level issues that compounds the performance issues.
[ Want to speed up your Magento sites for better performance? Our website technicians will audit and fix your websites in no time. ]
Website maintenance issues & Magento server bottlenecks
- Poor web server optimization – To serve an app as heavy as Magento, the web server needs to be as fast as possible. We’ve seen sites using Apache (instead of Nginx), compression not enabled, expires headers not enabled, Etags enabled, and more such settings, that puts needless pressure on the website.
- Poor PHP optimization – Not all PHP modules are created equal. We’ve seen sites that use Apache mod_php, where as there exists high performance alternatives such as PHP-FPM and HHVM. Even if the right module is used, it is important to give it the right settings such as memory size, execution time, max variable limit, etc.
- Slow database server – Magento is dependent heavily on the database. So, even a small issue with optimzation can have a large impact on performance. We’ve seen sites that had unoptimized MySQL settings such as query cache, table cache size, thread cache size, etc. We’ve even seen databases where log sizes exceeded 3 GB, that needlessly dragged the site.
- Poor cache systems – Just like choosing the right PHP engine, it is important to choose the right caching system for your website’s scale of operations. For eg., in a large website an HTML cache such as Varnish maybe required on top of a memory object cache such as MemCached. The choice must be made depending on the number of hits, and the size of your catalogs.
- Heavy Magento extensions – Every website falls for it at one time or another. You need an awesome feature that’s provided by your competitors. You search Magento Connect, and install one that looks good. But more often than not, it imposes a performance penalty – some much more heavily than others.
- Skipping periodic optimization – New products, categories, pages, or even stores get added to a Magento site all the time. Such changes negates any optimization you did on the website. Periodic performance audits need to be done on the website, and suitable changes (including upgrades) need to be performed to keep the site running smooth. See more details.
So, as you can see, Magento speed optimization is covers a wide range of activities that include Magento settings optimization, web server optimization, PHP optimization, database optimization, cache system optimization and periodic performance tuning.