<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>zlotkus.com</title>
	<atom:link href="http://www.zlotkus.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zlotkus.com</link>
	<description>Chasing my own deamons</description>
	<lastBuildDate>Wed, 22 Jun 2011 14:58:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Cherokee vs. Apache</title>
		<link>http://www.zlotkus.com/2011/06/cherokee-vs-apache/</link>
		<comments>http://www.zlotkus.com/2011/06/cherokee-vs-apache/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 11:24:44 +0000</pubDate>
		<dc:creator>Vaidas</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cherokee]]></category>
		<category><![CDATA[eaccelerator]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.zlotkus.com/?p=9</guid>
		<description><![CDATA[Some time ago I discovered a web server called Cherokee. The web server itself is promoted as &#8220;The Fastest free Web Server out there!&#8221;. So for a while I was just curious to do a benchmarks and compare it with &#8230; <a href="http://www.zlotkus.com/2011/06/cherokee-vs-apache/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some time ago I discovered a web server called <a title="Cherokee" href="http://www.cherokee-project.com/">Cherokee</a>. The web server itself is promoted as &#8220;The Fastest free Web Server out there!&#8221;. So for a while I was just curious to do a benchmarks and compare it with <a title="Apache" href="http://httpd.apache.org/">Apache</a> web server and see which one is faster in standard LAMP environment.</p>
<p>Why Apache vs. Cherokee? Because Apache is most common in LAMP environments and most widely used web server around the globe.</p>
<p>The main difference of Cherokee when compared with other web server software is that it is configured using web interface. The configuration file itself has a comment &#8220;don&#8217;t edit me by hand!&#8221; or something like that. Actually I was amazed with web interface, because it was very simple and easy to understand, user friendly and everything just worked <img src='http://www.zlotkus.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>BTW, for benchmarking I used FreeBSD box, because that&#8217;s the only one which I&#8217;ve got under my table at home.</p>
<p>I&#8217;ve chosen to test newest WordPress version by date (3.1.3) just running ab against index page. Both web applications were clean installs.</p>
<p>I&#8217;ve tested these configurations:</p>
<ul>
<li>Apache + mod_php</li>
<li>Cherokee + php-cgi (using FastCGI)</li>
<li>Apache + mod_php + eAccelerator extension</li>
<li>Cherokee + php-cgi (using FastCGI) + eAccelerator extension</li>
</ul>
<p>ab was doing 1000 requests with different concurrency levels (1, 5, 10, 20, 50 and 100).</p>
<p><strong>Web server software versions (compiled from ports):</strong></p>
<ul>
<li>Cherokee 1.2.2</li>
<li>Apache 2.2.19</li>
</ul>
<p><strong>Web application:</strong></p>
<ul>
<li>WordPress 3.1.3</li>
</ul>
<p><strong>Test system / environment:</strong></p>
<blockquote><p># Aspersa System Summary Report ##############################<br />
Date | 2011-06-21 20:49:12 UTC (local TZ: EEST +0300)<br />
Hostname | mercury.insplash.com<br />
Uptime | 43 days, 16:37, 2 users, load averages: 1.70, 14.19, 14.68<br />
Platform | FreeBSD<br />
Release | 7.4-RELEASE-p1<br />
Kernel | 199506<br />
Architecture | CPU = 64-bit, OS = 64-bit<br />
Virtualized | No virtualization detected<br />
# Processor ##################################################<br />
Processors | virtual = 4<br />
Speeds | 2331<br />
Models | Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz<br />
# Memory #####################################################<br />
Total | 4.0G<br />
Virtual | 4.8G<br />
Used | 1.9G<br />
UsedRSS | 22.4M</p></blockquote>
<p><strong>php info (without eAccelerator):</strong></p>
<blockquote><p>PHP 5.2.17 with Suhosin-Patch 0.9.7 (cli) (built: Jun 15 2011 14:03:49)<br />
Copyright (c) 1997-2009 The PHP Group<br />
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies<br />
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies<br />
with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies</p></blockquote>
<p><strong>php-cgi info (without eAccelerator):</strong></p>
<blockquote><p>PHP 5.2.17 with Suhosin-Patch 0.9.7 (cgi-fcgi) (built: Jun 15 2011 14:03:49)<br />
Copyright (c) 1997-2009 The PHP Group<br />
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies<br />
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies<br />
with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies</p></blockquote>
<p><strong>The Setup</strong></p>
<p>Cherokee&#8217;s and Apache&#8217;s configurations are practically default with no performance tuning or any additional modules.</p>
<p>PHP was tested with almost standard module set which is used by common PHP setups. Maybe you could just notice that it is with Suhosin Patch, but this one shouldn&#8217;t affect performance significantly. Zend optimizer is also pretty standard in LAMP setups. It is used just for loading encoded files.</p>
<p>eAccelerator configuration:</p>
<ul>
<li>eaccelerator.shm_size = &#8220;128&#8243;</li>
<li>eaccelerator.enable = &#8220;1&#8243;</li>
<li>eaccelerator.optimizer = &#8220;1&#8243;</li>
<li>eaccelerator.shm_only = &#8220;1&#8243;</li>
<li>eaccelerator.compress = &#8220;1&#8243;</li>
<li>eaccelerator.compress_level = &#8220;9&#8243;</li>
<li>eaccelerator.keys     = &#8220;shm_only&#8221;</li>
<li>eaccelerator.sessions = &#8220;shm_only&#8221;</li>
<li>eaccelerator.content  = &#8220;shm_only&#8221;</li>
</ul>
<p><strong>The Results</strong></p>
<p>The first table shows how many requests per second each setup could handle by increasing concurrency level.</p>
<table border="0" cellspacing="0" cellpadding="0" width="758">
<colgroup>
<col width="99"></col>
<col width="143"></col>
<col width="150"></col>
<col width="180"></col>
<col width="186"></col>
</colgroup>
<tbody>
<tr height="23">
<td colspan="5" width="758" height="23"><strong>Requests per second</strong></td>
</tr>
<tr height="22">
<td height="22"><strong>Concurrency</strong></td>
<td><strong>Apache + mod_php</strong></td>
<td><strong>Cherokee + php-cgi</strong></td>
<td><strong>Apache + mod_php + eA</strong></td>
<td><strong>Cherokee + php-cgi + eA</strong></td>
</tr>
<tr height="17">
<td height="17">1</td>
<td>4.64</td>
<td>4.99</td>
<td>14.59</td>
<td>19.33</td>
</tr>
<tr height="17">
<td height="17">5</td>
<td>16.14</td>
<td>16.97</td>
<td>24.22</td>
<td>62.97</td>
</tr>
<tr height="17">
<td height="17">10</td>
<td>15.95</td>
<td>17.33</td>
<td>15.00</td>
<td>62.69</td>
</tr>
<tr height="17">
<td height="17">20</td>
<td>15.85</td>
<td>17.22</td>
<td>9.89</td>
<td>61.93</td>
</tr>
<tr height="17">
<td height="17">50</td>
<td>15.47</td>
<td>17.17</td>
<td>2.81</td>
<td>62.04</td>
</tr>
<tr height="17">
<td height="17">100</td>
<td>15.21*</td>
<td>17.33</td>
<td>2.96**</td>
<td>62.72</td>
</tr>
</tbody>
</table>
<p>This table indicates the longest request time for each benchmark. From this table you can see that Cherokee is handling concurrent requests a lot better than Apache.</p>
<table border="0" cellspacing="0" cellpadding="0" width="758">
<colgroup>
<col width="99"></col>
<col width="143"></col>
<col width="150"></col>
<col width="180"></col>
<col width="186"></col>
</colgroup>
<tbody>
<tr height="23">
<td colspan="5" height="23"><strong>Longest request   (100%)</strong></td>
</tr>
<tr height="22">
<td height="22"><strong>Concurrency</strong></td>
<td><strong>Apache + mod_php</strong></td>
<td><strong>Cherokee + php-cgi</strong></td>
<td><strong>Apache + mod_php + eA</strong></td>
<td><strong>Cherokee + php-cgi + eA</strong></td>
</tr>
<tr height="17">
<td height="17">1</td>
<td>327</td>
<td>230</td>
<td>760</td>
<td>75</td>
</tr>
<tr height="17">
<td height="17">5</td>
<td>751</td>
<td>869</td>
<td>3671</td>
<td>146</td>
</tr>
<tr height="17">
<td height="17">10</td>
<td>4014</td>
<td>786</td>
<td>7081</td>
<td>235</td>
</tr>
<tr height="17">
<td height="17">20</td>
<td>11992</td>
<td>1452</td>
<td>13040</td>
<td>457</td>
</tr>
<tr height="17">
<td height="17">50</td>
<td>22081</td>
<td>3147</td>
<td>96152</td>
<td>921</td>
</tr>
<tr height="17">
<td height="17">100</td>
<td>29690*</td>
<td>6065</td>
<td>143878**</td>
<td>4560</td>
</tr>
</tbody>
</table>
<p>And the last one shows average request time for each benchmark.</p>
<table border="0" cellspacing="0" cellpadding="0" width="758">
<colgroup>
<col width="99"></col>
<col width="143"></col>
<col width="150"></col>
<col width="180"></col>
<col width="186"></col>
</colgroup>
<tbody>
<tr height="23">
<td colspan="5" height="23"><strong>Time per request   (mean, across all concurrent requests)</strong></td>
</tr>
<tr height="22">
<td height="22"><strong>Concurrency</strong></td>
<td><strong>Apache + mod_php</strong></td>
<td><strong>Cherokee + php-cgi</strong></td>
<td><strong>Apache + mod_php + eA</strong></td>
<td><strong>Cherokee + php-cgi + eA</strong></td>
</tr>
<tr height="17">
<td height="17">1</td>
<td>215.674</td>
<td>200.209</td>
<td>68.549</td>
<td>51.736</td>
</tr>
<tr height="17">
<td height="17">5</td>
<td>61.962</td>
<td>58.910</td>
<td>41.285</td>
<td>15.879</td>
</tr>
<tr height="17">
<td height="17">10</td>
<td>62.677</td>
<td>57.694</td>
<td>66.679</td>
<td>15.951</td>
</tr>
<tr height="17">
<td height="17">20</td>
<td>63.090</td>
<td>58.071</td>
<td>101.140</td>
<td>16.147</td>
</tr>
<tr height="17">
<td height="17">50</td>
<td>64.651</td>
<td>58.225</td>
<td>356.294</td>
<td>16.118</td>
</tr>
<tr height="17">
<td height="17">100</td>
<td>65.747*</td>
<td>57.715</td>
<td>338.261**</td>
<td>15.945</td>
</tr>
</tbody>
</table>
<p>* &#8211; Apache failed to serve 17 requests out of 1000</p>
<p>** &#8211; Apache failed to serve 793 requests out of 1000</p>
<p><em>So those results are not quite correct and influenced by failures.<br />
</em></p>
<p><strong>Conclusions</strong></p>
<p>When running benchmarks without eAccelerator you could see that Cherokee is a little bit faster. As concurrency grows Apache suffers some kind of concurrency / threading problems, because performance is degrading while Cherokee holds almost steady results.</p>
<p>A was very surprised when I saw that eAccelerator gives negative effect on Apache when concurrency level increases. While monitoring the process tree I saw some kind of flock() issues. I&#8217;ll try to investigate this deeper in the future.</p>
<p>eAccelerator and WordPress is a very good combination, because eA gives about 4x performance gain.</p>
<p>And yes! I know, I should benchmark some other web applications to get more objective results. I&#8217;ll do it in near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zlotkus.com/2011/06/cherokee-vs-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

