Back to Top

NginX in Magento

Updated 19 May 2017

Apache is the most popular Web server and one of the most successful open-source projects of all time. Since April 1996, Apache has served more Web sites than any other Web server. Many of the world’s largest Web sites, including YouTube, Facebook, Wikipedia and Craigslist, use Apache to serve billions of page views per month. Over the years, Apache has proven itself to be a very stable, secure and configurable Web server. Although Apache is an excellent Web server, what if there were an alternative with the same functionality, a simpler configuration and better performance? That Web server exists, and it’s called Nginx.

Nginx, pronounced “Engine X”, is a high-performance Web server and reverse proxy. It was created by Igor Sysoev for www.rambler.ru, Russia’s second-largest Web site. Rambler has used Nginx since summer 2004, and it’s currently serving about 500 million requests per day. Like Apache, Nginx is used by some of the largest Web sites in the US, including WordPress (#26), YouPorn (#27), Hulu and MochiMedia. As of May 2008, Nginx is the fourth-most-popular Web server, and it is currently serving more than two million Web sites. As it is only trailing behind Apache, IIS and GFE, it is effectively the second-most-popular Web server available for Linux.

Why Use Nginx?

Like Apache, Nginx has all the features you would expect from a leading Web server:

  • Static file serving.
  • SSL/TLS support.
  • Virtual hosts.
  • Reverse proxying.
  • Load balancing.
  • Compression.
  • Access controls.
  • URL rewriting.
  • Custom logging.
  • Server-side includes.
  • WebDAV.
  • FLV streaming.
  • FastCGI.

Why It is Useful With Magento :

We used AB (Apache benchmark) utility. We have checked how much pages each web-server generated during one minute, with 15 concurrent connections to the server. Servers configuration:

Searching for an experienced
Magento Company ?
Find out More

Old Server: – Litespeed (version 4.0.12) – Dual CPU Quadcore Intel Xeon; – 6GB RAM, – 4xHDD 15000 rpm RAID 1+0

New server: – NginX (version 0.7.65) – Single CPU DualCore Intel Xeon; – 2 GB RAM, – 1xHDD 7200 rpm.

Results:

Litespeed
Benchmarking ***.com:
Finished 672 requests
NginX
Benchmarking ***.com:
Finished 2761 requests

The results are really impressing. NginX performance is overhelming, even if the Litespeed server has much better hardware than NginX one.

Thats why MagentoCommrece and Demo site moves to Nginx

Detailed Results

Results for LiteSpeed:

Benchmarking ***.com (be patient)
Finished 672 requests
Server Software: LiteSpeed

Server Hostname: ***.com
Server Port: 80
Document Path: /magento/
Document Length: 23391 bytes
Concurrency Level: 15
Time taken for tests: 60.155 seconds
Complete requests: 672
Failed requests: 668
(Connect: 0, Length: 668, Exceptions: 0)
Write errors: 0
Keep-Alive requests: 0
Total transferred: 16052994 bytes
HTML transferred: 15770426 bytes
Requests per second: 11.20 [#/sec] (mean)
Time per request: 1339.289 [ms] (mean)
Time per request: 89.286 [ms] (mean, across all concurrent requests)
Transfer rate: 261.27 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 66 68 12.9 67 255
Processing: 587 1251 412.8 1137 5233
Waiting: 439 1092 401.4 986 5079
Total: 825 1320 411.7 1204 5300
Percentage of the requests served within a certain time (ms)
50% 1204
66% 1327
75% 1429
80% 1482
90% 1781
95% 2095
98% 2465
99% 2904
100% 5300 (longest request)

Results for NginX (Engine-X):

Benchmarking  ***.com (be patient)
Finished 2761 requests
Server Software: nginx/0.7.65

Server Hostname: ***.com
Server Port: 80
Document Path: /magento/
Document Length: 24471 bytes
Concurrency Level: 15
Time taken for tests: 60.1140 seconds
Complete requests: 2761
Failed requests: 0
Write errors: 0
Keep-Alive requests: 0
Total transferred: 68512771 bytes
HTML transferred: 67680271 bytes
Requests per second: 46.02 [#/sec] (mean)
Time per request: 325.975 [ms] (mean)
Time per request: 21.732 [ms] (mean, across all concurrent requests)
Transfer rate: 1115.10 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 30 74 30.2 69 153
Processing: 183 250 30.4 255 347
Waiting: 30 75 9.7 77 91
Total: 225 324 10.1 324 378
Percentage of the requests served within a certain time (ms)
50% 324
66% 327
75% 335
80% 335
90% 335
95% 336
98% 338
99% 346
100% 378 (longest request)

Related Links :

1 – http://webkul.com/magento-tutorial

2- http://webkul.com/magento-tutorial/magento

3 – http://webkul.com/magento-tutorial/nginx-in-magento

4 – http://webkul.com/magento-tutorial/magento-in-localhost

5 – http://webkul.com/magento-tutorial/how-to-import-csv-into-magento

6 – http://webkul.com/magento-tutorial/method-varien-object-tostring-cannot-take-arguments-in-magento

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home