Improving Performance of Your Magento Store from Technical Perspective

Slow Online Store Limits Your Ecommerce Opportunities

Following our previous article on migrating Magento stores to the cloud, today our Magento experts want to share some information about how to optimize and speed up Magento-powered websites with extensive traffic and lots of orders for a more efficient and profitable eCommerce business.

In case you interested in our service to optimized your Magento ecommerce store - please feel free to send us your project details and we will be happy to advice.

Request a Quote

Speed plays an important role in the success of eCommerce websites. The longer it takes for an online store to load the fewer chances remain to run an efficient business with a lot of loyal customers. An extended customer base is something any online entrepreneur dreams about, however too many customers using your online store can turn your sweet dream into a nightmare if you do not make sure that your Magento store is prepared for continuous growth and ever changing business requirements.

Magento Enterprise Edition offers a solid basis for a successful eCommerce business enjoying a large number of online visitors and transactions. Magento engineers have recently conducted an experiment to determine the best hardware and software configuration to optimize Magento Enterprise Edition for peak performance. They ran a few tests with peak activity simulations on different server configurations. The results of the experiment clearly showed what exactly can be done to speed up Magento stores, improve their efficiency and capacity and thus stop losing customers and accommodate more visitors on the online store.

Determine Optimal Magento Configuration for Peak Performance

The following configurations were compared during the performance tests to determine the optimal hardware and software configuration for a standard 2+1 (two nodes plus one database) setup:

  • Standard: Apache + MySQL — The most widely used configuration, combining the Web’s most popular HTTP server and open-source database.
  • Cache Optimized with Varnish: Varnish + Apache + Percona MySQL — An optimized configuration using Varnish (an open-source reverse proxy server), Apache, and Percona’s enhanced version of MySQL.
  • Cache Optimized with Nginx: Nginx + PHP-FPM + Percona MySQL — An optimized configuration of Nginx (a combined web server, caching proxy, and load balancing solution), PHP-FPM (the PHP FastCGI process manager), and Percona’s enhanced version of MySQL.

According to Magento engineers optimization of the caching configuration and tools dramatically improved Magento performance by offloading the application servers. So the main goal of the performance experiment was to offload back-end servers by serving as many pages as possible using third-party caching software in addition to native Magento full page caching. So the engineers added Cached Optimized with Varnish and Cache Optimized with Nginx configurations to the standard and the most popular Apache + MySQL infrastructure.

Testing Parameters

The following eCommerce parameters were set in each test scenario:

  • Number of websites: 1
  • Number of stores and store views: 1
  • Number of categories and products: 50 categories/100,000 products
  • Users per simulation: 2,800
  • Conversion rate ranging from 3% – 6%
  • Concurrency rate: 100 catalog page views/sec

The following testing tools were used:

  • A load testing and benchmarking utility Siege v. 2.72
  • An open source stress tool Gatling v. 1.1.0

Hardware used while the performance testing:

  • CPU: 2 x Intel® Xeon® CPU E5645 @ 2.40GHz
  • HDD: RAID1 - LSI MegaRAID SAS 9260-4i; 2 x SAS 164GB 15,000rpm
  • RAM: 24GB ECC
  • Network Interface Card: Intel 1GB 82576
  •  

    The following software was installed on the performance testing servers:

    • Magento Enterprise Edition 1.11.2.0
    • Apache 2.2.15, mpm_prefork, mod_php
    • PHP 5.3.10
    • MySQL 5.5
    • Pecl memcache 3.0.6
    • Varnish 2.1.5
    • Nginx 1.0.15
    • PHP-FPM 5.3.10
    • Percona MySQL 5.5
    • Memcached 1.4.4
    • Operating system: Red Hat Enterprise Linux version 6.2 (Santiago) x86_64

    Test Results

    Standard Configuration: Apache with MySQL

    magento standard configuration apache mysql

    • Number of orders (clients): 2,800
    • Time required to process all orders: 900 seconds
    • Orders/per sec (average): 3.11
    • Response time (average): 2.11 sec
    • Web server load: 100%
    • Concurrent visitors: 100 page views/sec
    Click to enlarge

    With the Standard configuration, the system was able to serve approximately 268,700 orders and 79,500,000 catalog views per day.

    Cache Optimized with Varnish

    magento configuration apache mysql varnish

    • Number of orders (clients): 2,800
    • Time required to process all orders: 496 sec
    • Orders/per sec (average): 5.65
    • Response time (average): 1.052 sec
    • CPU load: 100%
    • Concurrent visitors: 100 page views/sec
    Click to enlarge

    The system was able to serve approximately 487,300 orders or 79,500,000 catalog views per 24-hour period. The CPU load on web servers during the orders scenario test was as high as it was in the Standard Apache + MySQL architecture (close to 100%). However, due to the aggressive caching of static files as well as catalog pages, the bar was raised to handle 1.8 times additional orders. This architecture can easily serve more than 4,000 catalog page views per second from a single server with Varnish — whereby the only limiting factor is the network interface (1Gbit in these tests). To increase the number of catalog pages served to a client, you can add extra network cards or set up a 10Gbit network. For scaling dynamic content, you must add extra application servers.

    Cache Optimized with Nginx

    magento store configuration apache mysql nginx

    • Number of orders (clients): 2,800
    • Time required to process all orders: 460 sec
    • Orders/per sec (average): 6.09
    • Response time (average): 1.237 sec
    • CPU load: 100%
    • Concurrent visitors: 100 page views/sec
    Click to enlarge

    With a configuration optimized by implementing caching inside the FastCGI module of the Nginx server, the system was able to serve approximately 525,300 orders or 373,200,000 catalog views per 24-hour period. During an order scenario test, the CPU load on the web servers was as high as it was on the Standard configuration. However, this configuration managed to offload the system by serving static files to Nginx and aggressively caching catalog pages. This resulted in almost doubling the number of orders created. This architecture can easily serve more than 4,000 catalog page views per second from a single server with Nginx — the only limiting factor is the network connectivity (1Gbit in these tests). To increase the number of catalog pages served to the client, you can add extra network cards or set up a 10Gbit network. For scaling dynamic content, you must add extra application servers.

    Comparison of Optimized Architectures (Chart)

    Magento optimized server architecture
    Click to enlarge

    Conclusion

    Proper configuration of Magento Enterprise Edition is the right way to improve performance of your eCommerce business, speed up your online store and boost your bottom line due to a more efficient service offered to site visitors and customers. If your Magento-powered online business is constantly growing you’ll have to scale up your online store capacities, so you might need to offload your standard Apache+MySQL server architecture from serving static content by means of additional cache servers in order to double the number of orders and increase the number of catalog views which the system can handle.

    To optimize hardware/software configuration with an ideal caching scheme, the following components are recommended:

    • Cache server — a caching layer; in this case, either Varnish or Nginx
    • Application server — one or more servers capable of serving dynamic requests; in this case, the Apache web server or the PHP FastCGI process manager
    • Cache storage — storage in RAM or on the disk in which cached documents are stored

    The results of Magento engineers’ testing demonstrate that optimizing 2+1 configurations using Varnish or Nginx can lead to significant increases in performance. Optimizing the hardware/software configuration with Varnish or Nginx produces impressive results. However, due to differences in their designs, each configuration improves performance in different areas. While Nginx produces better server response times, Varnish does better when it comes to the amount of data being processed. When deciding between Varnish and Nginx, consider these points: Nginx can be a point of SSL termination; it provides flexible virtual hosting; and preserves cache between restarts. On the other hand, Varnish supports more flexible cache rule definitions due to the Varnish Configuration Language. According to the testers using Nginx with PHP-FPM slightly outperforms Varnish with Apache (by 8%). The main bottleneck is the application server CPU bandwidth. With more servers dedicated to handling dynamic requests, more orders can be processed.

    You can learn about the Magento Enterprise Edition performance testing conducted by Magento engeeneers in more details from the following technical whitepaper:

    If you require an expert help in optimizing your existing Magento store or if you are looking for an experienced team to build a high quality online store for you from scratch, QuartSoft Ltd., being a Magento’s Bronze Solution Partner, can professionally meet all your eCommerce needs and requirements.

    Comments: