{"id":478,"date":"2009-11-30T23:26:54","date_gmt":"2009-12-01T05:26:54","guid":{"rendered":"http:\/\/75.134.27.61:8101\/wordpress\/?p=478"},"modified":"2012-08-14T20:50:43","modified_gmt":"2012-08-15T01:50:43","slug":"nginx-vs-tornado-web-vs-apache-performance-benchmark","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/nginx-vs-tornado-web-vs-apache-performance-benchmark\/","title":{"rendered":"nginx vs Tornado Web vs Apache Performance Benchmark"},"content":{"rendered":"<p>Let&#8217;s put the nginx, Tornado and Apache and see who is the winner.<\/p>\n<h3><strong>What to test: <\/strong><\/h3>\n<p>A simple Hello World webpage.<\/p>\n<h3><strong>How:<\/strong><\/h3>\n<pre>ab -n 10000 -c 300 http:\/\/myserver.ip<\/pre>\n<h3><strong>Test Environment:<\/strong><\/h3>\n<p>OS: Ubuntu 9.10 (32-bit) \/ Linux 2.6.31<br \/>\nCPU: Pentium Celeron M 1.5 GHz<br \/>\nRam: 512 MB<br \/>\nApache: 2.2.12<br \/>\nPHP: 5.2.10<br \/>\nPython: 2.6<br \/>\nTornado: 0.2<br \/>\nnginx: 0.6.13<\/p>\n<h3><strong>Result:<\/strong><\/h3>\n<p><strong>Apache<\/strong><\/p>\n<pre>Server Software:        Apache\/2.2.12\r\nServer Port:            80\r\n\r\nDocument Path:          \/\r\nDocument Length:        13 bytes\r\n\r\nConcurrency Level:      300\r\nTime taken for tests:   5.295 seconds\r\nComplete requests:      10000\r\nFailed requests:        0\r\nWrite errors:           0\r\nTotal transferred:      2863146 bytes\r\nHTML transferred:       130143 bytes\r\nRequests per second:    <strong>1888.58<\/strong> [#\/sec] (mean)\r\nTime per request:       158.850 [ms] (mean)\r\nTime per request:       0.529 [ms] (mean, across all concurrent requests)\r\nTransfer rate:          528.05 [Kbytes\/sec] received\r\n\r\nConnection Times (ms)\r\n              min  mean[+\/-sd] median   max\r\nConnect:        0    8 151.0      0    3028\r\nProcessing:     0  122 602.0     48    5289\r\nWaiting:        0  122 600.8     48    5284\r\nTotal:         10  130 622.1     49    5292\r\n\r\nPercentage of the requests served within a certain time (ms)\r\n  50%     49\r\n  66%     50\r\n  75%     50\r\n  80%     51\r\n  90%     53\r\n  95%     63\r\n  98%     68\r\n  99%   5271\r\n 100%   5292 (longest request)<\/pre>\n<p><strong>nginx<\/strong><\/p>\n<pre>Server Software:        nginx\/0.6.13\r\nServer Port:            8000\r\n\r\nDocument Path:          \/\r\nDocument Length:        13 bytes\r\n\r\nConcurrency Level:      300\r\nTime taken for tests:   3.172 seconds\r\nComplete requests:      10000\r\nFailed requests:        0\r\nWrite errors:           0\r\nTotal transferred:      2230000 bytes\r\nHTML transferred:       130000 bytes\r\nRequests per second:    <strong>3152.12<\/strong> [#\/sec] (mean)\r\nTime per request:       95.174 [ms] (mean)\r\nTime per request:       0.317 [ms] (mean, across all concurrent requests)\r\nTransfer rate:          686.45 [Kbytes\/sec] received\r\n\r\nConnection Times (ms)\r\n              min  mean[+\/-sd] median   max\r\nConnect:        0    2  68.3      0    3057\r\nProcessing:     0   70 359.1     27    3164\r\nWaiting:        0   70 359.1     26    3164\r\nTotal:         10   72 365.6     27    3169\r\n\r\nPercentage of the requests served within a certain time (ms)\r\n  50%     27\r\n  66%     27\r\n  75%     27\r\n  80%     27\r\n  90%     28\r\n  95%     29\r\n  98%     32\r\n  99%   3157\r\n 100%   3169 (longest request)<\/pre>\n<p><strong>Tornado Web:<\/strong><\/p>\n<pre>Server Software:        TornadoServer\/0.1\r\nServer Port:            8888\r\n\r\nDocument Path:          \/\r\nDocument Length:        12 bytes\r\n\r\nConcurrency Level:      300\r\nTime taken for tests:   5.109 seconds\r\nComplete requests:      10000\r\nFailed requests:        0\r\nWrite errors:           0\r\nTotal transferred:      1680000 bytes\r\nHTML transferred:       120000 bytes\r\nRequests per second:    <strong>1957.33<\/strong> [#\/sec] (mean)\r\nTime per request:       153.270 [ms] (mean)\r\nTime per request:       0.511 [ms] (mean, across all concurrent requests)\r\nTransfer rate:          321.12 [Kbytes\/sec] received\r\n\r\nConnection Times (ms)\r\n              min  mean[+\/-sd] median   max\r\nConnect:        0   32 309.3      0    3035\r\nProcessing:    33  103  28.5    103     375\r\nWaiting:       33  102  28.5    103     375\r\nTotal:         36  135 311.3    103    3154\r\n\r\nPercentage of the requests served within a certain time (ms)\r\n  50%    103\r\n  66%    105\r\n  75%    108\r\n  80%    112\r\n  90%    116\r\n  95%    126\r\n  98%    313\r\n  99%   3121\r\n 100%   3154 (longest request)<\/pre>\n<p><strong>What do these numbers mean?<\/strong><\/p>\n<p>In a given time, if nginx and Tornado Web can handle <strong>1.66<\/strong> and <strong>1.036<\/strong> times more requests than Apache, respectively! In the other words, the server is more efficient and it can use the saved resource to do something else!<\/p>\n<p>&#8211;Derrick<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s put the nginx, Tornado and Apache and see who is the winner. What to test: A simple Hello World webpage. How: ab -n 10000 -c 300 http:\/\/myserver.ip Test Environment: <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/nginx-vs-tornado-web-vs-apache-performance-benchmark\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[94,144,6],"tags":[8,20,57,19,56],"class_list":["post-478","post","type-post","status-publish","format-standard","hentry","category-computer-problems-computer-help-pc-support","category-sever-problem","category-technology","tag-apache","tag-benchmark","tag-nginx","tag-performance","tag-tornado-web"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-7I","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":462,"url":"https:\/\/icesquare.com\/wordpress\/tornado-web-very-fast\/","url_meta":{"origin":478,"position":0},"title":"Tornado Web Server &#8211; Very Fast!","author":"Derrick","date":"November 29, 2009","format":false,"excerpt":"I just did a benchmark comparison on Tornado Web Server and Apache + PHP server. The result is pretty amazing. What to test: A simple Hello World application. How: ab -n 1000 -c 300 http:\/\/myserver.ip Test Environment OS: FreeBSD 7.1 CPU: Pentium III 933 MHz Ram: 256 MB PHP: 5.2.9\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":87,"url":"https:\/\/icesquare.com\/wordpress\/performance-benchmark-freebsd-vs-ubuntu-vs-os-x-which-one-is-better\/","url_meta":{"origin":478,"position":1},"title":"Performance Benchmark: FreeBSD vs Ubuntu vs OS X, which one is better?","author":"Derrick","date":"May 22, 2009","format":false,"excerpt":"If you cannot decide whether you should go with FreeBSD or Ubuntu (or Linux), check out this article: FreeBSD or Linux in 6 Simple Questions Recently I am working on building a web farm which is formed by three ancient time computers (The sum of their ages is older than\u2026","rel":"","context":"In &quot;FreeBSD&quot;","block_context":{"text":"FreeBSD","link":"https:\/\/icesquare.com\/wordpress\/category\/sever-problem\/freebsd\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":351,"url":"https:\/\/icesquare.com\/wordpress\/installing-apache-on-snow-leopard-os-x-10-6\/","url_meta":{"origin":478,"position":2},"title":"Installing Apache on Snow Leopard (OS X 10.6)","author":"Derrick","date":"October 30, 2009","format":false,"excerpt":"The Apache web server comes with the OS X is a bit out dated. So I decided to install a new one. After I tried installing it using mac port, it kept giving error. Finally, I built the Apache from source, and it worked! Grep Apache from here. Download the\u2026","rel":"","context":"In &quot;Server Problems&quot;","block_context":{"text":"Server Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/sever-problem\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":851,"url":"https:\/\/icesquare.com\/wordpress\/comments-on-running-webservers-at-home-part-1\/","url_meta":{"origin":478,"position":3},"title":"Comments on running webservers at home &#8211; Part 1","author":"Derrick","date":"September 9, 2010","format":false,"excerpt":"I like to experiment all kind of computer technologies especially server applications. I am not one of those who is satisfied with just making a website and putting it in somewhere. I like the full control of the server because I like to try different combination of applications for performance\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3925,"url":"https:\/\/icesquare.com\/wordpress\/freebsdupgrade-php-5-5-to-5-6\/","url_meta":{"origin":478,"position":4},"title":"[FreeBSD]Upgrade PHP 5.5 to 5.6","author":"Derrick","date":"February 20, 2015","format":false,"excerpt":"It is not easy to upgrade PHP 5.5 to 5.6 in FreeBSD. Without proper preparation, the upgrade process may drive you nut. Before you decide to get your hands wet, here are what I recommend you to do: Back up your files Test your website in a PHP 5.6 environment\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":730,"url":"https:\/\/icesquare.com\/wordpress\/fetch-ftpftp-freebsd-orgpubfreebsdportsdistfilesngx-fancyindex-0-2-2-tar-bz2-file-unavailable-e-g-file-not-found-no-access\/","url_meta":{"origin":478,"position":5},"title":"fetch: ftp:\/\/ftp.FreeBSD.org\/pub\/FreeBSD\/ports\/distfiles\/ngx-fancyindex-0.2.2.tar.bz2: File unavailable (e.g., file not found, no access)","author":"Derrick","date":"June 9, 2010","format":false,"excerpt":"Today I tried to run the upgrade my nginx on my FreeBSD box, and I received the following message: ===> Vulnerability check disabled, database not found ===> License accepted by the user ===> Found saved configuration for nginx-0.7.66 => ngx-fancyindex-0.2.2.tar.bz2 doesn't seem to exist in \/usr\/ports\/distfiles\/. => Attempting to fetch\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/comments?post=478"}],"version-history":[{"count":13,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/478\/revisions"}],"predecessor-version":[{"id":2921,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/478\/revisions\/2921"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}