
Well, we have long been interested in how fast will Magento work on NginX server, finally we’ve got a chance to test this. One of the clients has moved his Magento-based store from Litespeed server onto NginX one.
How we tested it:
We used AB (Apache benchmark) utility. We have checked how many pages each web-server generated within one minute, with 15 concurrent connections to the server.
Servers configuration:
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 |
Software Configuration:
There was identical copies of the same store on both servers, store is based on Magento version 1.4.0.1.
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.
No surprise why Varien moved Magento site and demo store to NginX.
P.S. our client is really happy, because now he can use cheaper server hardware without the speed affecting.
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)
|
Turnkey Ecommerce Solutions (Turnkey E) is a full service Internet solution agency and custom development company with strong team of IT eCommerce professionals. We are specializing on eCommerce solutions with full life cycle support.
This entry was posted
on Saturday, April 10th, 2010 at 8:48 am and is filed under Development, Hosting.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
[...] This post was mentioned on Twitter by NginxHosting and NginxHosting, Ecommerce Solutions. Ecommerce Solutions said: NginX vs LiteSpeed: Magento Benchmark Tests – http://turnkeye.com/blog/2010/04/nginx-vs-litespeed-test-magento/ #nginx #litespeed [...]
Thanks for posting this, helped me prove my point in another article’s comments section
You are welcome
There are 668 failed requests (almost 50%) with your Litespeed benchmark, so this result is not very correct. Maybe -c 5 or -c 10 only?
Developers of LiteSpeed argue that 255 concurrent visitors is fine for LiteSpeed.
So it is OK to test it with -c 15
Guys from NginxHosting test their servers with 200-300 and even 1000 concurent visitors! It is something beyond my mind.
NginX is state of art software, and this is why the whole WordPress/Magento/Comodo/SourceForge/Etc infrostructure was moved to NginX.
Can you tell us more about how the benchmark tests were performed?
Looks like the network speed to LiteSpeed is much slower than that to the Nginx server.
Would you mind installing LiteSpeed on the Nginx server and do the benchmark under the same environment?
[...] NginX vs LiteSpeed: Magento Benchmark Tests « TurnkeyE Blog [...]
Terrific work! This is the type of information that should be shared around the web. Shame on the search engines for not positioning this post higher!
I really enjoyed this post, especially the “examples in this post” portion which made it really easy for me to SEE what you were talking about without even having to leave the article. Thanks
They’re right, it’s possible even with Apache with the right config. My little box has far less power than yours (Single Quad Xeon, 4 GB, 1x HDD 7200rpm), but it handles easily C100 (I didn’t test more, it’s useless).
So I doubt about your Lightspeed config.
And with Magento, there’re also PHP/MySQL. Webserver shouldn’t be the bottleneck.
Valuable info. Lucky me I found your site by accident, I bookmarked it.
…
NginX vs LiteSpeed: Magento Benchmark #nginx #magento #hosting #ecommerce…
Just want to say what a great blog you got here!
I’ve been around for quite a lot of time, but finally decided to show my appreciation of your work!
Thumbs up, and keep it going!
Cheers
Christian, iwspo.net
[...] NginX vs LiteSpeed: Magento Benchmark Tests « TurnkeyE Blog [...]
Thanks for
your sharing, it’s very useful
Can anyone here help, I have spent about maybe 2 weeks now trying to replicate these results using different OS, nginx versions, php versions, ramdrive etc and I cant get anything above the results bellow. All test are ran on a local network. Any help/suggestions greatly appreciated.
My Hardware
Dell poweredge 1850
2 xeons dual core
3 gig ram
10k drives RAID1
Running Fedora 13
used string: ab -c 15 t- 60 http://www.***.com
Server Software: nginx/0.7.65
Server Hostname: www.***.com
Server Port: 80
Document Path: /
Document Length: 21591 bytes
Concurrency Level: 15
Time taken for tests: 60.017 seconds
Complete requests: 578
Failed requests: 0
Write errors: 0
Total transferred: 12729872 bytes
HTML transferred: 12479598 bytes
Requests per second: 9.63 [#/sec] (mean)
Time per request: 1557.543 [ms] (mean)
Time per request: 103.836 [ms] (mean, across all concurrent requests)
Transfer rate: 207.13 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 1
Processing: 880 1538 247.7 1547 2859
Waiting: 842 1492 231.5 1508 2155
Total: 881 1538 247.7 1547 2859
Percentage of the requests served within a certain time (ms)
50% 1547
66% 1628
75% 1677
80% 1719
90% 1837
95% 1928
98% 2082
99% 2159
100% 2859 (longest request)
Hello, Jake.
There are 2 points which you should pay attention to:
1. We need to know what file you request because it is not clear by your description:
_____________________
ab -c 15 t- 60 http://www.***.com
_____________________
We need to know if it is a static *.html file or *.PHP one.
2. If you request a dynamic PHP page, we need to know what is the version of PHP and the way it configured.
If you request a static HTML page, please ensure that you have the following directives in the config file:
___________________________
sendfile on;
keepalive_timeout 15;
gzip on;
gzip_min_length 1024;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/xml text/css text/js application/x-javascript image/png image/gif image/jpeg image/jpg;
proxy_buffers 8 64k;
proxy_intercept_errors on;
proxy_connect_timeout 1s;
proxy_read_timeout 3s;
proxy_send_timeout 3s;
___________________________
P.S. Also we noticed you use RAID1 drives, it may be a bottleneck of your system because the writing process in such configurations is raver slow. You might try 1+0, it can give you a good speed up, however it will require 4 drives (and more money).
You can try to speed up your current configuration by disabling the logging of the server requests for images, it can be done by following directives:
____________________________________
location ~* \.(gif|jpg|png) {
access_log off;
}
____________________________________
WOW, thank you for such a fast reply. This is a Magento setup so I am request index.php. I have tried a static 10kb file and it served over 50k requests so its very fast on static files VERY FAST. I thought that RAID1 might be a bottleneck so I made a ramdrive and moved the whole www dir to ram drive and had it served from ram and the results were the same. I use spawn-fcgi /usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php-cgi -P /var/run/fastcgi-php.pid -C 10 I do notice that all my 4 CPU cores go to 100% when I am running AB for the index.php and it only goes to about 8% when I do the static file and that is only on 1 core so I think my problem is with PHP setting somwhere or that is the max the server can handle. I also ran the AB with same sting on Magentos demo web store as and I get similar results from their server. I would love to run RAID 1+0 but the poweredge only has 2 bays. Bellow is the info you requested
PHP – v
PHP 5.3.2 (cli) (built: Apr 30 2010 05:43:36)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
Oh yes, and I disabled logging as well to see if that was the outcome, and increased mysql cache and connection limit. Just a hunch but I think the bottlenect might be spawn-fcgi its receiving to many requests and its not cloding the threads properly thus explaining the high cpu load but im not sure how to test that properly. Again thanx a lot
Hi Jake.
There are a couple recommendations that can speed up your store:
- Try to replace spawn-fcgi script with the PHP-FPM, i.e. re-compile PHP with PHP-FPM patch
- try to install PHP extensions: eaccelerator OR APC
- Try to re-configure your PHP, so it will require more resources but will work faster. For instance try to configure memory limit, zlib compression, output buffering, etc. Magento requires many PHP resources, so PHP may be a bottleneck of your configuration.
And of course, our qualified Nginx administrators can configure your server for your needs, if you have interested just let us know:)
…
This really is truly good news. Thank you for discussing it with us!…
Ouch good! Nginx is awesome! But very stupid server
[...] nginx vs. litespeed, is one better for a web server? Especially for a high traffic site. See http://turnkeye.com/blog/2010/04/ngi…-test-magento/ as you again manage to ask a question without providing any shred of information and without [...]
Question – was this LiteSpeed Standard or Enterprise. We are looking at LiteSpeed, it looks great, but the standard version is just that – standard, not much better than Apache. So if you all were using Enterprise, then I may have to re-look at my plans.
finally found this one. and i am right. NginX
Thank you for Benchmark Tests…
Hi, I don’t think this test is very realistic. Probably the old litespeed server wad configuration and maybe network problems. Anyway, just to clarify, I should test the inverse way, probably litespeed would give 4 times more performance than nginx. Try it and let us know
Digital…
Great information! I’ve been looking for something like this for a while now. Thanks!…
Tks…
Great information! I’ve been looking for something like this for a while now. Thanks!…
“We have checked how many pages each web-server generated within one minute, with 15 concurrent connections to the server.” wow, that was impressive!
[...] http://turnkeye.com/blog/nginx-vs-li…-test-magento/ PlusWebHost replied: Interesting. I’ve always found NginX to be amazingly fast (and preferred to Litespeed due to Litespeed’s TOS), but I didn’t think it would trump Litespeed by so much. I’d like to see more data between the two with varying softwares. [...]
Is the LNAMP will work fine than LNMP ?
You used php-fpm or another fgastcgi spawn?
Hi Alberto,
Yes, we use php-fpm.
thanks for test
my site(http://mihanfun.tk) use nginx and nginx very good!
I like nginx+apache+php. apache is a good friend of php
We also did some tests on NginX with Magento,
and we are really stunned by the performance it’s giving.
We are using an Amazon EC2 server with clustered services for our
databases, mail and storage. (RDS, SES, EBS)
Even the loadtimes to the servers with connections from outside
the country, are lower then other hosters.
With some smart configuration, the lack of htaccess support
does not weight up to the performance!
Honestly you should post more details on your tests because nginx is not that fasters over litespeed. Something must be terrible wrong in your litespeed config, most reviews put them on the same level.