30.06.2016 Views

Magento Site Performance Optimization

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Starting with the Right Hardware<br />

Measuring performance<br />

We measure the performance of each topic using various tools. Among them, the<br />

main ones are Pingdom tools, Mozilla Firebug, Google Speed Tracker, and Google<br />

Page Speed. Also, we stress our server using the small yet powerful Apache<br />

Benchmark. Apache Benchmark is a simple load testing tool that allows fake HTTPS<br />

requests to be generated. We will come back to that later, but as an example, the<br />

following command will test how fast google.com can handle 100 requests. Among<br />

these 100 requests, 10 are concurrent:<br />

ab -n 100 -c 10 http://www.google.com/<br />

As expected, the ab part refers to Apache Benchmark, -n the number of requests<br />

and -c the concurrent request. At last, the target address comes. The result will be<br />

something similar to the following output:<br />

Benchmarking www.google.com (be patient).....done<br />

Document Path: /<br />

Document Length:<br />

Concurrency Level: 10<br />

Time taken for tests:<br />

Complete requests: 100<br />

Failed requests: 4<br />

258 bytes<br />

0.816 seconds<br />

Total transferred:<br />

HTML transferred:<br />

Requests per second:<br />

Time per request:<br />

Time per request:<br />

Transfer rate:<br />

108684 bytes<br />

25792 bytes<br />

122.50 [#/sec] (mean)<br />

81.635 [ms] (mean)<br />

8.163 [ms] (mean, across all concurrent requests)<br />

130.01 [Kbytes/sec] received<br />

If you don't have Apache Benchmark installed yet, you can have it<br />

quickly by entering the following command:<br />

sudo apt-get install apache2-utils<br />

It is now time to introduce you to our test environment and the first result. We will<br />

use a fresh install of Ubuntu 12.04.3 server with the LAMP version that we can install<br />

when installing the system. The server runs with 512 MB of RAM, 8 GB of hard drive<br />

(SSD), and one CPU at 1.80 GHz.<br />

If you are not familiar with the default <strong>Magento</strong> and the associated test data, the<br />

following screenshot shows <strong>Magento</strong> Community Edition 1.8 and the test data 1.6.1<br />

as they look out of the box:<br />

[ 8 ]<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!