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.

Chapter 2<br />

Configuration tweaks<br />

In this subsection, we will only modify the /etc/nginx/nginx.conf file. This<br />

file is the main configuration file of the Nginx web server. The first tweak in this<br />

configuration file will be to get the event section to look similar to the following code:<br />

events {<br />

worker_connections 1024;<br />

multi_accept on;<br />

use epoll;<br />

}<br />

Then, we have to uncomment the following parameters:<br />

server_tokens off;<br />

sendfile<br />

on;<br />

tcp_nopush<br />

on;<br />

tcp_nodelay<br />

on;<br />

You can then set the gzip section to the following:<br />

gzip<br />

on;<br />

gzip_vary<br />

on;<br />

gzip_proxied any;<br />

gzip_types<br />

text/css application/x-javascript;<br />

gzip_buffers 16 8k;<br />

gzip_comp_level 6;<br />

gzip_min_length 1024;<br />

It may seem little, but Nginx is already the most powerful server. Let's discover<br />

how the performances have been increased by these modifications. The Nginx<br />

performance after the modifications is as follows:<br />

Document Path:<br />

Document Length:<br />

/magento/index.php/furniture/living-room.html<br />

15729 bytes<br />

Concurrency Level: 5<br />

Time taken for tests: 31.614 seconds<br />

Complete requests: 100<br />

Failed requests: 0<br />

Write errors: 0<br />

Non-2xx responses: 100<br />

Total transferred: 1619000 bytes<br />

HTML transferred: 1572900 bytes<br />

Requests per second: 3.16 [#/sec] (mean)<br />

[ 35 ]<br />

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!