| | 44 | <!-- Benchmark marker --> |
|---|
| | 45 | |
|---|
| | 46 | |
|---|
| | 47 | |
|---|
| | 48 | |
|---|
| | 49 | <h2>Cherokee 0.8.1 benchmark</h2> |
|---|
| | 50 | This is just a quick benchmark made by <a href="http://www.alobbs.com/1345/Cherokee_0_8_1_benchmark.html">Alvaro</a> to have something to show on the release date. Better, more representative benchmarks should be added shortly. |
|---|
| | 51 | |
|---|
| | 52 | <hr> |
|---|
| | 53 | |
|---|
| | 54 | <p>Today, after releasing <a href="http://lists.octality.com/pipermail/cherokee/2008-August/008749.html">Cherokee 0.8.1</a> I decided it was time to test again how it was doing about performance. In the last months we have got a great new I/O cache layer and a couple of structural changes that were supposed to have a positive impact on the general server performance, although nobody checked whether those changes were as effective as we aimed them to be.</p> |
|---|
| | 55 | |
|---|
| | 56 | <p>So, once again, here I am bringing good news. We have done it. Cherokee is actually the fastest web server among a set of the most common servers nowadays: Apache, Cherokee, Lighttpd and Nginx!!</p> |
|---|
| | 57 | |
|---|
| | 58 | <div align="center"><img src="http://www.alobbs.com/images/web-servers-benchmark-20080819.jpg" /></div> |
|---|
| | 59 | |
|---|
| | 60 | <p>The benchmark consisted on half a million requests of a 1.7KiB static file, with 20 concurrent clients, using a 1Gbit/s local network. The results (fastest to slowest) were:</p> |
|---|
| | 61 | |
|---|
| | 62 | <p>Cherokee:</p> |
|---|
| | 63 | <pre class="shell">Server Software: Cherokee/0.8.1 |
|---|
| | 64 | Server Hostname: 10.0.0.102 |
|---|
| | 65 | Server Port: 80 |
|---|
| | 66 | |
|---|
| | 67 | Document Path: /index.html |
|---|
| | 68 | Document Length: 1795 bytes |
|---|
| | 69 | |
|---|
| | 70 | Concurrency Level: 20 |
|---|
| | 71 | Time taken for tests: 17.819725 seconds |
|---|
| | 72 | Complete requests: 500000 |
|---|
| | 73 | Failed requests: 0 |
|---|
| | 74 | Write errors: 0 |
|---|
| | 75 | Keep-Alive requests: 500000 |
|---|
| | 76 | Total transferred: 999007442 bytes |
|---|
| | 77 | HTML transferred: 897506630 bytes |
|---|
| | 78 | Requests per second: 28058.79 [#/sec] (mean) |
|---|
| | 79 | Time per request: 0.713 [ms] (mean) |
|---|
| | 80 | Time per request: 0.036 [ms] (mean, across all concurrent requests) |
|---|
| | 81 | Transfer rate: 54747.93 [Kbytes/sec] received</pre> |
|---|
| | 82 | |
|---|
| | 83 | <p>Lighttpd:</p> |
|---|
| | 84 | <pre class="shell">Server Software: lighttpd/1.4.19 |
|---|
| | 85 | Server Hostname: 10.0.0.102 |
|---|
| | 86 | Server Port: 80 |
|---|
| | 87 | |
|---|
| | 88 | Document Path: /index.html |
|---|
| | 89 | Document Length: 1795 bytes |
|---|
| | 90 | |
|---|
| | 91 | Concurrency Level: 20 |
|---|
| | 92 | Time taken for tests: 21.248000 seconds |
|---|
| | 93 | Complete requests: 500000 |
|---|
| | 94 | Failed requests: 0 |
|---|
| | 95 | Write errors: 0 |
|---|
| | 96 | Keep-Alive requests: 470598 |
|---|
| | 97 | Total transferred: 991856958 bytes |
|---|
| | 98 | HTML transferred: 897503590 bytes |
|---|
| | 99 | Requests per second: 23531.63 [#/sec] (mean) |
|---|
| | 100 | Time per request: 0.850 [ms] (mean) |
|---|
| | 101 | Time per request: 0.042 [ms] (mean, across all concurrent requests) |
|---|
| | 102 | Transfer rate: 45585.94 [Kbytes/sec] received</pre> |
|---|
| | 103 | |
|---|
| | 104 | <p>NginX:</p> |
|---|
| | 105 | <pre class="shell">Server Software: nginx/0.5.33 |
|---|
| | 106 | Server Hostname: 10.0.0.102 |
|---|
| | 107 | Server Port: 80 |
|---|
| | 108 | |
|---|
| | 109 | Document Path: /index.html |
|---|
| | 110 | Document Length: 1795 bytes |
|---|
| | 111 | |
|---|
| | 112 | Concurrency Level: 20 |
|---|
| | 113 | Time taken for tests: 23.741872 seconds |
|---|
| | 114 | Complete requests: 500000 |
|---|
| | 115 | Failed requests: 0 |
|---|
| | 116 | Write errors: 0 |
|---|
| | 117 | Keep-Alive requests: 500000 |
|---|
| | 118 | Total transferred: 1006000217 bytes |
|---|
| | 119 | HTML transferred: 897500000 bytes |
|---|
| | 120 | Requests per second: 21059.84 [#/sec] (mean) |
|---|
| | 121 | Time per request: 0.950 [ms] (mean) |
|---|
| | 122 | Time per request: 0.047 [ms] (mean, across all concurrent requests) |
|---|
| | 123 | Transfer rate: 41379.30 [Kbytes/sec] received</pre> |
|---|
| | 124 | |
|---|
| | 125 | <p>Apache2.2:</p> |
|---|
| | 126 | <pre class="shell">Server Software: Apache/2.2.8 |
|---|
| | 127 | Server Hostname: 10.0.0.102 |
|---|
| | 128 | Server Port: 80 |
|---|
| | 129 | |
|---|
| | 130 | Document Path: /index.html |
|---|
| | 131 | Document Length: 1795 bytes |
|---|
| | 132 | |
|---|
| | 133 | Concurrency Level: 20 |
|---|
| | 134 | Time taken for tests: 35.438605 seconds |
|---|
| | 135 | Complete requests: 500000 |
|---|
| | 136 | Failed requests: 0 |
|---|
| | 137 | Write errors: 0 |
|---|
| | 138 | Keep-Alive requests: 495064 |
|---|
| | 139 | Total transferred: 1043777896 bytes |
|---|
| | 140 | HTML transferred: 897500000 bytes |
|---|
| | 141 | Requests per second: 14108.91 [#/sec] (mean) |
|---|
| | 142 | Time per request: 1.418 [ms] (mean) |
|---|
| | 143 | Time per request: 0.071 [ms] (mean, across all concurrent requests) |
|---|
| | 144 | Transfer rate: 28762.81 [Kbytes/sec] received</pre> |
|---|
| | 145 | |
|---|
| | 146 | <p>For the record: I did my best configuring all the servers in the very same way. In all the cases I removed unnecessary rules that could have slowed down the server (checks for htpasswd files and so on). And all the binaries came from the Debian repository, except for Cherokee 0.8.1 that hasn't been packaged yet.</p> |
|---|
| | 147 | |
|---|
| | 148 | <p>Anyway, this benchmark has been just a quick test. It is not certainly representing the result that these servers would have handling real traffic though. So, in the following days I will try to do a new a more accurate benchmark with static and dynamic content, compression, redirections, etc. I'm pretty sure the results will be even better.</p> |
|---|
| | 149 | </div> |
|---|
| | 150 | |
|---|
| | 151 | |
|---|
| | 152 | |
|---|
| | 153 | |
|---|
| | 154 | |
|---|
| | 155 | <!-- Benchmark marker --> |
|---|
| | 156 | <hr> |
|---|
| | 157 | |
|---|
| 154 | | <h3>Other 0.6 benchmarks</h3> |
|---|
| 155 | | <ul> |
|---|
| 156 | | <li><a href="http://code.google.com/p/cherokee/wiki/CherokeeBenchmarkBrian">Cherokee + Apache + Lighttpd Benchmark</a></li> |
|---|
| 157 | | </ul> |
|---|
| | 268 | |
|---|
| | 269 | |
|---|
| | 270 | |
|---|
| | 271 | <!-- Benchmark marker --> |
|---|
| | 272 | <hr> |
|---|
| | 273 | |
|---|
| | 274 | <h2>Cherokee + Apache + Lighttpd Benchmark</h2> |
|---|
| | 275 | <p>This benchmark was performed by <a href="http://oebfare.com">Brian Rosner</a> with Cherokee 0.6.0 beta2.</p> |
|---|
| | 276 | <h3>Software</h3><ul><li>cherokee 0.6.0 beta2 </li><li>apache 2.0.59 </li><li>lighttpd 1.4.16 </li></ul><h2>Hardware</h2><ul><li>733 MHz PIII </li><li>256 MB RAM </li><li>80GB 7200RPM IDE HD </li><li>Debian GNU/Linux 4.0 </li></ul><h2>Background</h2><p>I installed a fresh installation of Debian on the server hardware. Right after you login you will need to get sudo to perform root commands from your account: </p><pre class="shell">su |
|---|
| | 277 | apt-get install sudo</pre><p>Then add yourself to the <tt>/etc/sudoers</tt> file by running <tt>visudo</tt> and adding yourself in the user section. I just followed the root entry as this does not need to be a very secure server since it will not be running publicly. Now make sure you get back to your account and do: </p><pre class="shell">sudo apt-get install gcc make automake autoconf libtool |
|---|
| | 278 | mkdir src ; cd src |
|---|
| | 279 | sudo mkdir /usr/local/cherokee |
|---|
| | 280 | sudo mkdir /usr/local/lighttpd</pre><p>The installed version of gcc is 4.1.2 </p><h2>Cherokee Setup Details</h2><p>The following is what I executed to build Cherokee: </p><pre class="shell">wget http://www.cherokee-project.com/download/0.6/0.6.0/cherokee-0.6.0b863.tar.gz |
|---|
| | 281 | tar zxvf cherokee-0.6.0b863.tar.gz |
|---|
| | 282 | cd cherokee-0.6.0b863 |
|---|
| | 283 | ./configure --prefix=/usr/local/cherokee/0.6.0b863 |
|---|
| | 284 | make |
|---|
| | 285 | sudo make install</pre><p>Here is the configuration for cherokee: </p><pre class="shell">server!port = 80 |
|---|
| | 286 | server!timeout = 60 |
|---|
| | 287 | server!keepalive = 1 |
|---|
| | 288 | server!keepalive_max_requests = 500 |
|---|
| | 289 | server!pid_file = /var/run/cherokee.pid |
|---|
| | 290 | server!server_tokens = full |
|---|
| | 291 | server!encoder!gzip!allow = html,html,txt |
|---|
| | 292 | server!panic_action = /usr/local/cherokee/0.6.0b863/bin/cherokee-panic |
|---|
| | 293 | server!mime_files = /usr/local/cherokee/0.6.0b863/etc/cherokee/mime.types |
|---|
| | 294 | |
|---|
| | 295 | vserver!default!document_root = /usr/local/cherokee/0.6.0b863/var/www |
|---|
| | 296 | vserver!default!directory_index = index.html |
|---|
| | 297 | |
|---|
| | 298 | vserver!default!directory!/!handler = common |
|---|
| | 299 | vserver!default!directory!/!handler!iocache = 1 |
|---|
| | 300 | vserver!default!directory!/!priority = 1</pre><p>To run the web server I used: </p><pre class="shell">cd /usr/local/cherokee/0.6.0b863 |
|---|
| | 301 | sudo sbin/cherokee -C etc/cherokee/cherokee.conf</pre><h2>Apache Setup Details</h2><p>The following is what I executed to build Apache: </p><pre class="shell">wget http://apache.oregonstate.edu/httpd/httpd-2.0.59.tar.gz |
|---|
| | 302 | tar zxvf httpd-2.0.59.tar.gz |
|---|
| | 303 | cd httpd-2.0.59 |
|---|
| | 304 | ./configure --prefix=/usr/local/apache/2.0.59 |
|---|
| | 305 | make |
|---|
| | 306 | sudo make install</pre><p>I used the supplied <tt>highperformance.conf</tt> configuration file. I started the server with: </p><pre class="shell">cd /usr/local/apache/2.0.59 |
|---|
| | 307 | sudo bin/httpd -k start -f conf/highperformance.conf</pre><p>The server ran using prefork. </p><h2>Lighttpd Setup Details</h2><p>The following is what I executed to build lighttpd: </p><pre class="shell">wget http://www.lighttpd.net/download/lighttpd-1.4.16.tar.gz |
|---|
| | 308 | tar zxvf lighttpd-1.4.16.tar.gz |
|---|
| | 309 | cd lighttpd-1.4.16 |
|---|
| | 310 | ./configure --prefix=/usr/local/lighttpd/1.4.16 |
|---|
| | 311 | make |
|---|
| | 312 | sudo make install</pre><p>The configuration I used looked like this: </p><pre class="shell">server.modules = ( |
|---|
| | 313 | "mod_access", |
|---|
| | 314 | "mod_accesslog" |
|---|
| | 315 | |
|---|
| | 316 | ) |
|---|
| | 317 | |
|---|
| | 318 | server.document-root = "/var/www" |
|---|
| | 319 | |
|---|
| | 320 | mimetype.assign = ( |
|---|
| | 321 | ".html" => "text/html", |
|---|
| | 322 | ".txt" => "text/plain" |
|---|
| | 323 | |
|---|
| | 324 | )</pre><p>I started the server with: </p><pre class="shell">cd /usr/local/lighttpd/1.4.16 |
|---|
| | 325 | sudo sbin/lighttpd -f sbin/lighttpd.conf</pre><h2>Benchmark</h2><p>I will perform several different benchmarks on each webserver. This is to help gauge what type of performance each server can handle in the different conditions. Each test will have SSL turned on and turned off. </p><h3>small static file test</h3><ul><li>filesize: 99 bytes </li><li>command: <tt>ab -c 2 -t 2 -k http://localhost/index0.html</tt> </li></ul><h3>large static file test</h3><ul><li>filesize: 1.5MB </li><li>command: <tt>ab -c 2 -t 2 -k http://localhost/static.txt</tt> </li></ul><h2>Results</h2><p>I have included cherokee with both iocaching on and off. The out of the box setting is that iocache is turned on. </p><h3>small static file test w/ keepalive</h3><ul><li>cherokee 0.6.0b863 w/ iocache - 7816 reqs./sec. </li><li>cherokee 0.6.0b863 w/o iocache - 5761 reqs./sec. </li><li>lighttpd 1.4.16 - 4884 reqs./sec. </li><li>apache 2.0.59 - 2924 reqs./sec. </li></ul><p><img src="http://www.cherokee-project.com/images/benchmark1.png" /> </p><h3>small static file test w/o keepalive</h3><ul><li>cherokee 0.6.0b863 w/ iocache - 2182 reqs./sec. </li><li>cherokee 0.6.0b863 w/o iocache - 1874 reqs./sec. </li><li>lighttpd 1.4.16 - 2255 reqs./sec. </li><li>apache 2.0.59 - 1250 reqs./sec. </li></ul><h3>large static file test w/ keepalive</h3><ul><li>cherokee 0.6.0b863 w/ iocache - 108 reqs./sec. </li><li>cherokee 0.6.0b863 w/o iocache - 107 reqs./sec. </li><li>lighttpd 1.4.16 - 106 reqs./sec. </li><li>apache 2.0.59 - 94 reqs./sec. </li></ul><p><img src="http://www.cherokee-project.com/images/benchmark2.png" /> </p><h3>large static file test w/o keepalive</h3><ul><li>cherokee 0.6.0b863 w/ iocache - 88 reqs./sec. </li><li>cherokee 0.6.0b863 w/o iocache - 88 reqs./sec. </li><li>lighttpd 1.4.16 - 92 reqs./sec. </li><li>apache 2.0.59 - 118 reqs./sec. </li></ul><h2>Conclusion</h2><p>TODO: write something here </p><p>If you feel I need to supply any more detail about any part of this process, please let me know. I want this test to be as accurate as possible. I also would like to continue using this process to test future releases of each software and ultimately help improve them. I am a Cherokee developer, but if I notice anything that would help other webservers I am more than happy to let that community know. </p> |
|---|
| | 326 | |
|---|
| | 327 | |
|---|
| | 328 | |
|---|
| | 329 | |
|---|
| | 330 | |
|---|
| | 331 | |
|---|
| | 332 | <!-- Benchmark marker --> |
|---|
| | 333 | <hr> |
|---|
| | 334 | |
|---|