One simple way to optimise your Magento site and improve performance on commonly viewed pages by 1,000x

January 31 2014, by Macquarie Technology Group | Category: Technology Group

Many of our customers use the Magento eCommerce platform to power their online presence. This means that our team of support engineers has a great deal of experience in how to get the best performance from this popular platform.

Magento is a great solution for eCommerce because the customisation options and extensions allow you to create a professional, robust site without reinventing the wheel. However, the ‘out of the box’ settings are designed for simplicity rather than pure performance, so you need to tweak certain settings to get the best performance.

As an example, here’s one of the simplest optimisations you can do – adding a front-end cache. Properly configuring Varnish and Magento will allow static and frequently viewed dynamic pages to be cached and rendered to the browser much faster. Varnish also takes the PHP load off the server which means that your website can handle many more users simultaneously and many more transactions per second.

We ran two identical virtual servers and installed the Varnish cache on one. This simple change improved performance over 1290x than the standard installation.

Read on for more detail on how you can get the same performance boost:


We installed 2 identical virtual machines with identical sets of server resources before installing Magento Community Edition 1.8.

System #1 System #2
System Resources System Resources
CPUs: 4 X 2.0 GHz CPUs: 4X 2.0 GHz
RAM: 2GB RAM: 2GB
HDD: 20GB HDD: 20GB
Platform Stack Platform Stack
OS: Fedora Core 19 OS: Fedora Core 19
Webserver: Apache 2.4.6 Webserver: Apache 2.4.6
Database: MySQL MariaDB 5.5.33 Database: MySQL MariaDB 5.5.33
PHP: PHP 5.5.6 PHP: PHP 5.5.6
Cache: Varnish Cache 3.0.3

 

System #1 was left un-optimised but had Magento settings tuned to allow for maximum recommended performance settings. System #2 was optimised and setup to use Varnish cache as a front end cache system.

Each system had the Magento Sample Data set installed along with 2000 dummy users and 10000 sample products. The dummy users were generated using n98-magerun.phar. The sample products were imported using MAGMI from a CSV file containing the products (available here) . The Fontis Australia extension was also installed on each system and the Locale options were setup for Australia / Sydney.

Using the Siege HTTP load testing and benchmarking utility, each system was tested multiple times in 4 different scenarios. The Siege utility was run from the server being tested in each case, so network speed and latency were not factors in this test – only server transaction capacity and volume.

The 4 different testing scenarios were:

  1. 15 second home page test with 50 users
  2. 15 second product page test with 50 users
  3. 15 second product listing page test with 50 users
  4. 120 second home page test with 100 users

15 Second Homepage Test with 50 Users.

chart1

15 Second Product Page Test with 50 Users.

Chart 2

15 Second Product Listing Page Test with 50 Users.

Chart 3

120 Second Homepage Test with 100 Users.

Chart 4Based on the above results, the average percentage performance increase factor was 1291.67 times better performance on static and frequently viewed pages.

If you’ve got experience running Magento sites, what are the other essential extensions and optimisations that you recommend? Leave a comment below or tell us on Twitter at @MacquarieTelco.