Magento performance analysis
Posted on 15 May 2016
Many owners of Magento stores are not satisfied by their website speed. Slow websites have low traffic as Google factors speed into search ranking.
Website speed also impacts on your conversion rate. The slower your website, the less is sales conversion and the higher bounce rate.
This article will help you to learn the answer on question “Why Magento is so slow?”. This article also contains practical recommendations so that you could learn how to make an analyse of Magento performance, and how to make your Magento store faster.
Tools for Magento performance analysis
There are plenty of free services which allows analysing performance of any website. Our favourite ones are GTMetrix and WebPagetest. GTMetrix includes both Google PageSpeed test and Yahoo YSlow test, so there is no need to run tests on GooglePageSpeed anymore. Moreover, GTMetrix has a lot of other useful features, for example GTMetrix can store and compare performance reports, test your website using different browsers, locations and devices. Moreover, it has scheduled tests and email alerts so you can be alerted if your store speed has become slow.
Analysis of Magento page loading process
First, let's learn more about page loading process. The image below displays the process of loading a webpage by a browser in a timeline view.
Let's take a look at the performance report for a clean Magento 220.127.116.11 installation
(To generate a report for your website please go to http://www.webpagetest.org and after generating a report please open “Details” tab.)
So, browser downloaded electronics.html page (9.8KB without resources) within 1.76 seconds, while full web-page (410KB with resources) was downloaded within 4.4 seconds.
Let's see the process of downloading a page without resources in details:
As we can see on the image above, browser spent 149ms on searching requested website (DNS Lookup column) and 36ms to establish connection (Initial Connection column).
Time to First Byte
Time to First Byte column is very important part of loading a website because it's the moment when the loading of page content and its resources started. Time to First Byte (TTFB) represents how quickly a website — Magento in our case — prepares a requested web-page. The TTFB of a new Magento installation is about 1.5-2 seconds. If you install any popular custom frontend theme full of modules and enhancements, then TTFB can be about 10 seconds.
As we can see, browser spent 1634ms on TTFB and 14ms on content download.
Max parallel connections
Then we can see that the resources were downloaded asynchronously. The reason is Max parallel connections per host limitation. Here is a table with maximum number of parallel connections for most popular browsers. To learn more about the limitations click here.
- The loading of a web-page depends on a number of resources on a page. The less resources, the faster page loads.
- The loading of a web-page will be faster if download resources from different domains (hosts).
- The faster browser loads a resource, the faster browser starts downloading the next one.
Magento performance improvement
How to speed up Initial Connection and DNS Lookup?
To improve the process of establishing connection between a browser and a server, you need to locate your server (or a group of servers) as close to your potential visitors as possible. To make that you can use Load Balancing method. This method will improve time spent on establishing connections and improve downloading content by a browser as well.
You can also use Content Delivery Network (CDN) to speed up Initial Connection and DNS Lookup. CDN is used to download content from the nearest locations.
How to decrease TTFB?
To improve that index you need to use Full Page Caching. Our Full Page Cache extension for Magento significantly improves TTFB (see results in the end of this article). The less is TTFB, the faster browser start downloading of a page content and its resources.
How to decrease number of requests?
- Eliminate all unused and unnecessary resources
- Combine images into sprites
- Use Expires header
How to speed up downloading of page resources?
- Enable HTTP Compression. Important!
- Optimize images used on your website. We recommend using Image Compression extension for Magento that has built-in image optimization processor.
- Use CDN.
We installed JS/CSS Compressor + Image Optimization and Full Page Cache extensions on this Magento installation. These extension use most of those tips above, and here is the result — TTFB changed from 1634ms to 220ms, while page loading times changed from 4.54sec to 2.78sec.
As you can see, total page loading time improved on 63%, while TTFB has become 7 times better. The number of downloadable resources decreased from 49 to 26. Magento extensions from PotatoCommerce produce dramatic results and available at affordable prices.
Speed up your Magento store with Magento Optimization Tools developed by PotatoCommerce company.
Platform: Magento 1.9, RWD theme
Server location: Netherlands
Tools for analysis: http://www.webpagetest.org