{"id":122,"date":"2009-12-29T17:19:18","date_gmt":"2009-12-29T21:19:18","guid":{"rendered":"http:\/\/blog.litespeedtech.com\/?p=122"},"modified":"2009-12-29T17:19:18","modified_gmt":"2009-12-29T21:19:18","slug":"benchmark-comparison-on-serving-small-static-files-litespeed-vs-apache-vs-nginx","status":"publish","type":"post","link":"https:\/\/lswp.store\/index.php\/2009\/12\/29\/benchmark-comparison-on-serving-small-static-files-litespeed-vs-apache-vs-nginx\/","title":{"rendered":"Benchmark Comparison on Serving Small Static Files: LiteSpeed vs Apache vs Nginx"},"content":{"rendered":"<p><strong>To see all of our latest results, visit the <a href=\"https:\/\/www.litespeedtech.com\/benchmarks\">benchmarks page on our site<\/a>. <\/strong><\/p>\n<p>To perform a fair benchmark requiring a lot of preparation, as you need to know the detail of each product and set appropriate configuration. Recently, we got chance to do some internal testing.<!--more--> It\u2019s experimental, however the result is good enough to make some points and may be useful to our users, so we would like to share it in a series of blog posts first. Feel free to provide any feedback, so we can improve on our formal benchmark tests later on.<\/p>\n<p>This time we will compare web server performance on serving small static files. Comparing small files is standard practice for benchmark, as this can reveal web server performance instead of network being saturated by large files first. We will compare LiteSpeed, Apache and Nginx with different configurations on serving small static files.<\/p>\n<p><strong>Software version:\u00a0<span style=\"color: #000000; font-weight: normal;\">LiteSpeed 4.1RC2, Apache 2.2.14, Nginx 0.7.61.<\/span><\/strong><\/p>\n<p><strong><span style=\"color: #800000;\"><strong>Test Result<\/strong><\/span><\/strong><\/p>\n<table border=\"0\" cellspacing=\"1\" cellpadding=\"5\">\n<tbody>\n<tr style=\"background: #974807; color: white;\">\n<td>Round<\/td>\n<td>Apache<br \/>\n(worker)<\/td>\n<td>Apache<br \/>\n(event)<\/td>\n<td>Apache<br \/>\n(prefork)<\/td>\n<td>Nginx<br \/>\n(1 worker)<\/td>\n<td>LiteSpeed<br \/>\n(1 CPU)<\/td>\n<\/tr>\n<tr style=\"background: #E46D0A;\">\n<td colspan=\"6\" align=\"center\"><strong>Non-Keep-Alive<\/strong><\/td>\n<\/tr>\n<tr style=\"background: #FDE9D9;\">\n<td>1<\/td>\n<td>2570.63<\/td>\n<td>3192.56<\/td>\n<td>3342.65<\/td>\n<td>6616.52<\/td>\n<td>9217.25<\/td>\n<\/tr>\n<tr style=\"background: #FBD4B4;\">\n<td>2<\/td>\n<td>2555.7<\/td>\n<td>3150.34<\/td>\n<td>3275.96<\/td>\n<td>7098.36<\/td>\n<td>9474.72<\/td>\n<\/tr>\n<tr style=\"background: #FDE9D9;\">\n<td>3<\/td>\n<td>2562.29<\/td>\n<td>3159.37<\/td>\n<td>3309.69<\/td>\n<td>9609.46<\/td>\n<td>9526.48<\/td>\n<\/tr>\n<tr style=\"background: #FBD4B4;\">\n<td>4<\/td>\n<td>2534.73<\/td>\n<td>3181.72<\/td>\n<td>3392.23<\/td>\n<td>6525.97<\/td>\n<td>9550.62<\/td>\n<\/tr>\n<tr style=\"background: #FDE9D9;\">\n<td>Average<\/td>\n<td>2555.84<\/td>\n<td>3171.00<\/td>\n<td>3330.13<\/td>\n<td>7462.58<\/td>\n<td>9442.27<\/td>\n<\/tr>\n<tr style=\"background: #E46D0A;\">\n<td><strong>Rating<\/strong><\/td>\n<td><strong>100<\/strong><\/td>\n<td><strong>124<\/strong><\/td>\n<td><strong>130<\/strong><\/td>\n<td><strong>292<\/strong><\/td>\n<td><strong>369<\/strong><\/td>\n<\/tr>\n<tr>\n<td colspan=\"6\"><\/td>\n<\/tr>\n<tr style=\"background: #E46D0A;\">\n<td colspan=\"6\" align=\"center\"><strong>Keep-Alive<\/strong><\/td>\n<\/tr>\n<tr style=\"background: #FDE9D9;\">\n<td>1<\/td>\n<td>4957.55<\/td>\n<td>6571.35<\/td>\n<td>6668.33<\/td>\n<td>13862.73<\/td>\n<td>27487.78<\/td>\n<\/tr>\n<tr style=\"background: #FBD4B4;\">\n<td>2<\/td>\n<td>4609.48<\/td>\n<td>6482.42<\/td>\n<td>6595.71<\/td>\n<td>13729.05<\/td>\n<td>28333.26<\/td>\n<\/tr>\n<tr style=\"background: #FDE9D9;\">\n<td>3<\/td>\n<td>4321.93<\/td>\n<td>6709.53<\/td>\n<td>6655.88<\/td>\n<td>12319.22<\/td>\n<td>27872.33<\/td>\n<\/tr>\n<tr style=\"background: #FBD4B4;\">\n<td>4<\/td>\n<td>4384.76<\/td>\n<td>6323.04<\/td>\n<td>6633.4<\/td>\n<td>13123.33<\/td>\n<td>28788.51<\/td>\n<\/tr>\n<tr style=\"background: #FDE9D9;\">\n<td>Average<\/td>\n<td>4568.43<\/td>\n<td>6521.58<\/td>\n<td>6638.33<\/td>\n<td>13258.58<\/td>\n<td>28120.47<\/td>\n<\/tr>\n<tr style=\"background: #E46D0A;\">\n<td><strong>Rating<\/strong><\/td>\n<td><strong>100<\/strong><\/td>\n<td><strong>143<\/strong><\/td>\n<td><strong>145<\/strong><\/td>\n<td><strong>290<\/strong><\/td>\n<td><strong>616<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong><span style=\"color: #800000;\">Conclusion<\/span><\/strong><\/p>\n<p>LiteSpeed is apparently a big winner in this test. Apache worker and event model does not perform better than prefork model in serving small files. We are also surprised with LiteSpeed performance over Nginx, especially on keep-alive test.<\/p>\n<p><!--more--><\/p>\n<p><strong>Details<\/strong><\/p>\n<div>\n<table style=\"font-size: 9pt; border: solid #CDCDCD 1.0pt;\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\n<tbody>\n<tr>\n<td style=\"background: #DFDFDF;\">Server Software<\/td>\n<td style=\"background: #EFEFEF;\">apache\/2.2.14 (mpm prefork, worker, event), default setting + disable access log<br \/>\nnginx\/0.7.61 (1 worker) default setting + disable access log<br \/>\nlitespeed\/4.1RC2 (1cpu license), default setting + disable access log<\/td>\n<\/tr>\n<tr>\n<td style=\"background: #DFDFDF;\">Server Hardware<\/td>\n<td style=\"background: #EFEFEF;\">Dual Athlon MP 2000+\/266FSB\/256KB L2 Cache<br \/>\nMemory: 1GB PC2100<br \/>\nMotherboard: MSI K7D<br \/>\nHard Drive: 36GB 1000RPM SCSI drive<\/td>\n<\/tr>\n<tr>\n<td style=\"background: #DFDFDF;\">Server OS<\/td>\n<td style=\"background: #EFEFEF;\">Linux CentOS 5.4<\/td>\n<\/tr>\n<tr>\n<td style=\"background: #DFDFDF;\">Client Software<\/td>\n<td style=\"background: #EFEFEF;\">ApacheBench (ab) 2.3<\/td>\n<\/tr>\n<tr>\n<td style=\"background: #DFDFDF;\">Client Host Hardware<\/td>\n<td style=\"background: #EFEFEF;\">2 XEON E5410 2.33GHz with 8GB memory<br \/>\nMotherboard: ASUS DSEB-DG with 4Gpbs LAN ports<br \/>\nHard Drive: 4 SCSI 10Krpm RAID0<\/td>\n<\/tr>\n<tr>\n<td style=\"background: #DFDFDF;\">Network Switch<\/td>\n<td style=\"background: #EFEFEF;\">Dell PowerConnect 2624 24-Port Gigabit Ethernet Switch<\/td>\n<\/tr>\n<tr>\n<td style=\"background: #DFDFDF;\">Client VM<\/td>\n<td style=\"background: #EFEFEF;\">Linux 2.6.24-ovz-1.9-default #1 SMP<br \/>\nopenvz VM with 1GB memory, bridged Network connection over 1Gbps NIC<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><strong>Build apache with different model:<\/strong><\/p>\n<p style=\"font-size: 9pt;\">$ .\/configure &#8211;prefix=\/usr\/local\/apache-event &#8211;enable-mods-shared=all &#8211;with-mpm=event<br \/>\n$ .\/configure &#8211;prefix=\/usr\/local\/apache-event &#8211;enable-mods-shared=all &#8211;with-mpm=worker<br \/>\n$ .\/configure &#8211;prefix=\/usr\/local\/apache-event &#8211;enable-mods-shared=all &#8211;with-mpm=prefork<\/p>\n<p><strong>Test small html page<\/strong><\/p>\n<div style=\"background: #EFEFEF; border: 1; font-size: 9pt;\">#cat test.html<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;title&gt;Test page&lt;\/title&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n&lt;h1&gt;This is a test page&lt;\/h1&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/div>\n<p style=\"font-size: 9pt;\">Document Path: \/test.html<br \/>\nDocument Length: 101 bytes<br \/>\nEstimation target: Requests per second:[#\/sec] (mean) from ab<\/p>\n<p><strong>Test Parameters<\/strong><\/p>\n<p style=\"font-size: 9pt;\"><strong>non-keep-alive:<\/strong><br \/>\nnginx: ab -n 200000 -c 200 192.168.0.40:48130\/test.html<br \/>\nlitespeed: ab -n 200000 -c 200 192.168.0.40:48088\/test.html<br \/>\nmpm prefork: ab -n 200000 -c 200 192.168.0.40:48124\/test.html<br \/>\nmpm worker: ab -n 200000 -c 200 192.168.0.40:48120\/test.html<br \/>\nmpm event: ab -n 200000 -c 200 192.168.0.40:48122\/test.html<\/p>\n<p style=\"font-size: 9pt;\"><strong>keep-alive:<\/strong><br \/>\nnginx: ab -k -n 200000 -c 200 192.168.0.40:48130\/test.html<br \/>\nlitespeed: ab -k -n 200000 -c 200 192.168.0.40:48088\/test.html<br \/>\nmpm prefork: ab -k -n 200000 -c 200 192.168.0.40:48124\/test.html<br \/>\nmpm worker: ab -k -n 200000 -c 200 192.168.0.40:48120\/test.html<br \/>\nmpm event: ab -k -n 200000 -c 200 192.168.0.40:48122\/test.html<\/p>\n<p style=\"font-size: 9pt;\"><strong><em>Note:<\/em><\/strong> aio is not used in this test. For a small benchmark file like this, aio will actually introduce extra function call \/ cpu cycle which does not help, as the file is already in memory (kernel i\/o buffer).<\/p>\n<p style=\"font-size: 9pt;\">\n","protected":false},"excerpt":{"rendered":"<p>To see all of our latest results, visit the benchmarks page on our site. To perform a fair benchmark requiring a lot of preparation, as you need to know the detail of each product and set appropriate configuration. Recently, we got chance to do some internal testing.<\/p>\n","protected":false},"author":1,"featured_media":443,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[16,27,20],"tags":[37,196,271],"class_list":["post-122","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-benchmarks","category-web-server","category-performance","tag-apache-compatible","tag-nginx","tag-speed"],"jetpack_featured_media_url":"https:\/\/lswp.store\/wp-content\/uploads\/2013\/02\/2-DSunMar2007.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/comments?post=122"}],"version-history":[{"count":0,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/posts\/122\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media\/443"}],"wp:attachment":[{"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/media?parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/categories?post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lswp.store\/index.php\/wp-json\/wp\/v2\/tags?post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}