<?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>Naeh.net &#187; benchmark</title>
	<atom:link href="http://naeh.net/tag/benchmark/feed/" rel="self" type="application/rss+xml" />
	<link>http://naeh.net</link>
	<description>Le mémo du développeur</description>
	<lastBuildDate>Wed, 30 Jun 2010 18:56:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Lighttpd vs Apache vs Lighttpd + Apache</title>
		<link>http://naeh.net/lighttpd-vs-apache-vs-lighttpd-apache/</link>
		<comments>http://naeh.net/lighttpd-vs-apache-vs-lighttpd-apache/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 21:37:46 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[Divers]]></category>
		<category><![CDATA[Linux - Logiciels]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://naeh.net/?p=85</guid>
		<description><![CDATA[Il fut un temps où on ne se posait pas de question quant au serveur web, on prend Apache et on en parle plus, aujourd'hui les choses ont changé, Apache reste quand même le plus utilisé avec plus de 66% des parts de marché, suivi par IIS, puis tous les autres "petits" derrière, néanmoins en [...]]]></description>
			<content:encoded><![CDATA[<p>Il fut un temps où on ne se posait pas de question quant au serveur web, on prend Apache et on en parle plus, aujourd'hui les choses ont changé, Apache reste quand même le plus utilisé avec plus de 66% des parts de marché, suivi par IIS, puis tous les autres "petits" derrière, néanmoins en fonction des besoins, certains de ces petits peuvent s'avérer bien plus performants qu'Apache, aujourd'hui on va tester 3 configurations possibles avec Apache et Lighttpd.</p>
<p>d'après ce qu'on peut lire un peu partout sur le net, Lighttpd (lighty pour les intimes) est beaucoup plus performant quand il s'agit de servir des pages statiques, mais qu'en est-il vraiment ? et comment s'en sort-il avec le contenu dynamique ? (des sites statiques ça n'existe plus de nos jours ^^).</p>
<p>pour notre test, on va prendre un site très léger, basé sur Zend framework (donc loin d'être statique), contenant une page qui affiche 9 images au hasard a partir d'une tables mysql contenant environ 1000 enregistrements (seulement les emplacement des images sont stockés dans la base). Le serveur de test est un kimsufi L (petit processeur et 1Go de RAM).</p>
<p><strong>versions utilisées : </strong><br />
<a href="http://www.apache.org/" target="_blank">Apache 2.2.9</a><br />
<a href="http://www.lighttpd.net/" target="_blank">Lighttpd 1.4.19</a><br />
<a href="http://fr.php.net/" target="_blank">PHP 5.2.6</a></p>
<p>pour les tests on utilise <a href="http://packages.debian.org/fr/sid/siege" target="_blank">siege</a>, on lance donc un siege avec 100 concurrency sur 10 minutes, voici la commande :</p>

<div class="wp_codebox"><table><tr id="p856"><td class="code" id="p85code6"><pre class="bash" style="font-family:monospace;">siege <span style="color: #660033;">-c100</span> <span style="color: #660033;">-t10M</span> URL_DU_SITE</pre></td></tr></table></div>

<p>on note également le Load average de la machine a la fin de l'opération.</p>
<h2>1ère configuration : Lighttpd tout seul</h2>
<p>voici le resultat :</p>

<div class="wp_codebox"><table><tr id="p857"><td class="code" id="p85code7"><pre class="bash" style="font-family:monospace;">Load average : <span style="color: #000000;">4.87</span>
&nbsp;
Lifting the server siege...      done.
Transactions:		       <span style="color: #000000;">23859</span> hits
Availability:		      <span style="color: #000000;">100.00</span> <span style="color: #000000; font-weight: bold;">%</span>
Elapsed <span style="color: #000000; font-weight: bold;">time</span>:		      <span style="color: #000000;">600.37</span> secs
Data transferred:	       <span style="color: #000000;">83.25</span> MB
Response <span style="color: #000000; font-weight: bold;">time</span>:		        <span style="color: #000000;">2.02</span> secs
Transaction rate:	       <span style="color: #000000;">39.74</span> trans<span style="color: #000000; font-weight: bold;">/</span>sec
Throughput:		        <span style="color: #000000;">0.14</span> MB<span style="color: #000000; font-weight: bold;">/</span>sec
Concurrency:		       <span style="color: #000000;">80.21</span>
Successful transactions:       <span style="color: #000000;">23859</span>
Failed transactions:	           <span style="color: #000000;">0</span>
Longest transaction:	        <span style="color: #000000;">5.20</span>
Shortest transaction:	        <span style="color: #000000;">0.10</span></pre></td></tr></table></div>

<h2>2ème configuration : Apache2 tout seul</h2>
<p>le résultat :</p>

<div class="wp_codebox"><table><tr id="p858"><td class="code" id="p85code8"><pre class="bash" style="font-family:monospace;">Load average : <span style="color: #000000;">77.51</span>
&nbsp;
Lifting the server siege...      done.
Transactions:		       <span style="color: #000000;">23543</span> hits
Availability:		      <span style="color: #000000;">100.00</span> <span style="color: #000000; font-weight: bold;">%</span>
Elapsed <span style="color: #000000; font-weight: bold;">time</span>:		      <span style="color: #000000;">599.66</span> secs
Data transferred:	       <span style="color: #000000;">82.16</span> MB
Response <span style="color: #000000; font-weight: bold;">time</span>:		        <span style="color: #000000;">2.04</span> secs
Transaction rate:	       <span style="color: #000000;">39.26</span> trans<span style="color: #000000; font-weight: bold;">/</span>sec
Throughput:		        <span style="color: #000000;">0.14</span> MB<span style="color: #000000; font-weight: bold;">/</span>sec
Concurrency:		       <span style="color: #000000;">80.22</span>
Successful transactions:       <span style="color: #000000;">23543</span>
Failed transactions:	           <span style="color: #000000;">0</span>
Longest transaction:	       <span style="color: #000000;">10.51</span>
Shortest transaction:	        <span style="color: #000000;">0.05</span></pre></td></tr></table></div>

<h2>3ème configuration : Lighttpd + Apache</h2>
<p>maintenant faisons le test en couplant les 2, dans cette configuration tout ce qui est statique (images, css, js, etc.) sera servi par lighty alors que les scripts php eux, seront traités par apache, pour cela on active le mod_proxy dans lighty, et on ajoute le code suivant dans le vhost de notre site :</p>

<div class="wp_codebox"><table><tr id="p859"><td class="code" id="p85code9"><pre class="bash" style="font-family:monospace;"> <span style="color: #007800;">$HTTP</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">&quot;url&quot;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">!</span>~ <span style="color: #ff0000;">&quot;\.(js|css|gif|jpg|png|ico|txt|swf|html|htm)$&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
               proxy.server  = <span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #ff0000;">&quot;&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>
                               <span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #ff0000;">&quot;host&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;127.0.0.1&quot;</span>, <span style="color: #ff0000;">&quot;port&quot;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;">8080</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
                       <span style="color: #7a0874; font-weight: bold;">&#41;</span>
               <span style="color: #7a0874; font-weight: bold;">&#41;</span>
       <span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>

<p>vous l'aurez compris, Apache écoute sur le port 8080 (c'est fait en changeant le fichier /etc/apache2/ports.conf).</p>
<p>voici le résultat :</p>

<div class="wp_codebox"><table><tr id="p8510"><td class="code" id="p85code10"><pre class="bash" style="font-family:monospace;">Load average : <span style="color: #000000;">14.79</span>
&nbsp;
Lifting the server siege...      done.
Transactions:		       <span style="color: #000000;">22684</span> hits
Availability:		      <span style="color: #000000;">100.00</span> <span style="color: #000000; font-weight: bold;">%</span>
Elapsed <span style="color: #000000; font-weight: bold;">time</span>:		      <span style="color: #000000;">600.25</span> secs
Data transferred:	       <span style="color: #000000;">79.10</span> MB
Response <span style="color: #000000; font-weight: bold;">time</span>:		        <span style="color: #000000;">2.13</span> secs
Transaction rate:	       <span style="color: #000000;">37.79</span> trans<span style="color: #000000; font-weight: bold;">/</span>sec
Throughput:		        <span style="color: #000000;">0.13</span> MB<span style="color: #000000; font-weight: bold;">/</span>sec
Concurrency:		       <span style="color: #000000;">80.53</span>
Successful transactions:       <span style="color: #000000;">22684</span>
Failed transactions:	           <span style="color: #000000;">0</span>
Longest transaction:	        <span style="color: #000000;">8.61</span>
Shortest transaction:	        <span style="color: #000000;">0.07</span></pre></td></tr></table></div>

<p>plutôt surprenant !</p>
<h2>Conclusion :</h2>
<p>Lighty s'en sort très bien au vu des transactions/s (ou le nombre total de transactions traitées), contrairement a ce qu'on pouvait attendre, coupler les 2 nous fait perdre en performances (on enregistre quand même un load average nettement inférieur a la config d'apache tout seul).</p>
<p>personnellement ce que je retiens, c'est que lighty n'est pas si mauvais que ça pour le contenu dynamique, les performances restent quand très proches dans les 3 cas, donc autant utiliser la solution qui nous plait :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/lighttpd-vs-apache-vs-lighttpd-apache/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Benchmark PHP 5</title>
		<link>http://naeh.net/benchmark-php-5/</link>
		<comments>http://naeh.net/benchmark-php-5/#comments</comments>
		<pubDate>Sun, 02 Dec 2007 21:21:30 +0000</pubDate>
		<dc:creator>Naeh</dc:creator>
				<category><![CDATA[PHP / MySQL]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://wp.naeh.info/?p=8</guid>
		<description><![CDATA[Ce n'est pas vraiment un article mais plutôt un résumé d'un plus complet se trouvant sur Développez.com
Dans cette article, on verra comment différentes écriture de la même chose peuvent donner des résultats bien différents, comme la différence entre :

echo 'toto'
//et
echo &#34;toto&#34;

ou encore entre :

echo &#34;toto&#34;.$vaiable
//et
echo &#34;toto $variable&#34;

ou encore :

$i===NULL
//ou
is_null&#40;$i&#41;

allez sur cette adresse http://m-fernandez.developpez.com/articles/php/bench/ vous trouverez [...]]]></description>
			<content:encoded><![CDATA[<p>Ce n'est pas vraiment un article mais plutôt un résumé d'un plus complet se trouvant sur Développez.com</p>
<p>Dans cette article, on verra comment différentes écriture de la même chose peuvent donner des résultats bien différents, comme la différence entre :</p>

<div class="wp_codebox"><table><tr id="p814"><td class="code" id="p8code14"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'toto'</span>
<span style="color: #666666; font-style: italic;">//et</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;toto&quot;</span></pre></td></tr></table></div>

<p>ou encore entre :</p>

<div class="wp_codebox"><table><tr id="p815"><td class="code" id="p8code15"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;toto&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$vaiable</span>
<span style="color: #666666; font-style: italic;">//et</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;toto <span style="color: #006699; font-weight: bold;">$variable</span>&quot;</span></pre></td></tr></table></div>

<p>ou encore :</p>

<div class="wp_codebox"><table><tr id="p816"><td class="code" id="p8code16"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$i</span><span style="color: #339933;">===</span><span style="color: #009900; font-weight: bold;">NULL</span>
<span style="color: #666666; font-style: italic;">//ou</span>
<a href="http://www.php.net/is_null"><span style="color: #990000;">is_null</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>allez sur cette adresse <a href="http://m-fernandez.developpez.com/articles/php/bench/" target="_blank">http://m-fernandez.developpez.com/articles/php/bench/</a> vous trouverez le test complet, ça vaut le détour :-)</p>
<p>Bonne lecture...</p>
]]></content:encoded>
			<wfw:commentRss>http://naeh.net/benchmark-php-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
