<?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>Communauté Magento francophone &#187; Optimisation LAMP/Zend/Magento</title>
	<atom:link href="http://www.wikigento.com/category/optimisation-lampzendmagento/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wikigento.com</link>
	<description>Optimisation de sites E-commerce, hébergment Magento</description>
	<lastBuildDate>Mon, 30 Jan 2012 16:33:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Encore quelques outils pour optimiser</title>
		<link>http://www.wikigento.com/optimisation-lampzendmagento/encore-quelques-outils-pour-optimiser-magento/</link>
		<comments>http://www.wikigento.com/optimisation-lampzendmagento/encore-quelques-outils-pour-optimiser-magento/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 18:30:06 +0000</pubDate>
		<dc:creator>Philippe Humeau</dc:creator>
				<category><![CDATA[Optimisation LAMP/Zend/Magento]]></category>
		<category><![CDATA[optimisation]]></category>
		<category><![CDATA[optimisation magento]]></category>
		<category><![CDATA[performance magento]]></category>
		<category><![CDATA[innotop]]></category>
		<category><![CDATA[jetprofiler]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[mytop]]></category>
		<category><![CDATA[nitrogento]]></category>

		<guid isPermaLink="false">http://www.wikigento.com/?p=1987</guid>
		<description><![CDATA[Quelques outils intéressants Nitrogento Eh oui, il arrive&#8230; Après 6 mois développement et deux de Beta tests, des semaines de création de sites et de traduction de documentations, de benchmarks et de tests, voici qu&#8217;approche la sortie de Nitrogento ! Cette toute nouvelle extension pour Magento va vous permettre d&#8217;obtenir un &#171;&#160;All in one&#160;&#187; d&#8217;optimisation [...]]]></description>
			<content:encoded><![CDATA[<h2 style="text-align: justify;">Quelques outils intéressants</h2>
<h3 style="text-align: justify;">Nitrogento</h3>
<p style="text-align: justify;">Eh oui, il arrive&#8230;</p>
<p style="text-align: justify;">Après 6 mois développement et deux de Beta tests, des semaines de création de sites et de traduction de documentations, de benchmarks et de tests, voici qu&#8217;approche la sortie de <a title="magento performance" href="http://www.nitrogento.com">Nitrogento</a> !</p>
<p style="text-align: justify;">Cette toute nouvelle extension pour Magento va vous permettre d&#8217;obtenir un &laquo;&nbsp;All in one&nbsp;&raquo; d&#8217;optimisation :</p>
<ul style="text-align: justify;">
<li>Création du Sprite et patch du thème</li>
<li>Ventilation des ressources statiques sur les CDN</li>
<li>Concaténation, Minify et Compression des JS &amp; CSS et du HTML</li>
<li>Block caching des blocs qui ne sont pas déjà dans le cache Magento</li>
<li>Custom Caching, mettez votre propres blocs &laquo;&nbsp;maison&nbsp;&raquo; dans le système de Cache Magento</li>
<li>Full Page Cache, ehhhhh oui, même pour la CE !</li>
</ul>
<p style="text-align: justify;">Autant dire que ca va légèrement dynamiser votre site&#8230; De plus, les fameux blocs maisons (custom) qui ne sont pas gérés actuellement par le cache de Magento pourront y être intégrés grâce aux Hooks que crée Nitrogento pour vous.</p>
<p style="text-align: justify;">On va passer de Moogento à Maaaaagento, moi je vous le dis !</p>
<p style="text-align: justify;">Date prévue de sortie : le 3 mai 2011 !</p>
<h3 style="text-align: justify;">Jetprofiler</h3>
<p>Cet outil est une vraie petite merveille. Un bon monitoring de son Mysql, rien de tel.</p>
<p style="text-align: justify;">Comme expliqué dans mon précédent Post, le problème de mysql c&#8217;est qu&#8217;on ne peut pas le faire grossir proprement. En fait au dela de 4 cores, c&#8217;est inutile voir nuisible. Donc on multiplie les serveurs. Même si Magento ne tape pas très intensément sur la DB (en général) c&#8217;est parfois un des points de contention.</p>
<p style="text-align: justify;">Une implémentation particulièrement complexe au niveau SQL peut aussi provoquer des surcharges ou une Cron un peu gourmande. Bilan, le Mysql rame et on se demande pourquoi.</p>
<p style="text-align: justify;">Avec <a href="http://www.jetprofiler.com/">Jetprofiler</a>, vous pourrez rapidement trouver plus d&#8217;information, qualifier le problème en quelques clics.</p>
<h3>Pagespeed Online (by Google )</h3>
<p style="text-align: justify;">Alors ce n&#8217;est pas exactement nouveau, Google Pagespeed, on l&#8217;aime à la maison mais là, c&#8217;est le petit plus à la Google.</p>
<p style="text-align: justify;">Après le plugin pour Firefox, le GT Metrix, on a maintenant un chouette site dédié chez Google à Pagepseed. Rien de révolutionnaire mais c&#8217;est très pratique, notamment pour les gens comme moi qui ne sont pas fan de Firefox, car c&#8217;est en ligne. Mais en plus, c&#8217;est directement linké au niveau de la KB de Google et CA, c&#8217;est sympa.</p>
<p style="text-align: justify;">On ne sait pas ce que c&#8217;est que le Defer Javacript blablabla ? Eh ben on clic sur le lien &laquo;&nbsp;learn more&nbsp;&raquo; et c&#8217;est expliqué, merci Google. Allez, un petit exemple :</p>
<p style="text-align: justify;"><a href="http://pagespeed.googlelabs.com/#url=www.nbs-system.com">http://pagespeed.googlelabs.com/#url=www.nbs-system.com</a></p>
<h3 style="text-align: justify;">Mytop (mysqltop)</h3>
<p>Aussi simple que possible, Mytop, c&#8217;est comme le top d&#8217;unix mais pour Mysql.</p>
<p>Voila, tout est dit, un petit outil CLI (Command Line) pour permettre de monitorer en un clin d&#8217;oeil son Mysql. Ca ne va pas faire le même boulot que Jetprofiler mais c&#8217;est light et c&#8217;est déjà pas mal. <a title="Mytop" href="http://jeremy.zawodny.com/mysql/mytop/">http://jeremy.zawodny.com/mysql/mytop</a>/</p>
<p style="text-align: justify;">
<h3 style="text-align: justify;">Innotop</h3>
<p>Dans la série &laquo;&nbsp;top est notre ami&nbsp;&raquo;, innotop, ca parle, ca parle&#8230; de Top pour innodb. XAPRB nous délivre son outil plus avancé que mytop, bien plus avancé même, mais c&#8217;est un bonheur car pour les amoureux de la command line, il y a tout ou presque.</p>
<p><a href="http://www.xaprb.com/blog/2006/07/02/innotop-mysql-innodb-monitor/">http://www.xaprb.com/blog/2006/07/02/innotop-mysql-innodb-monitor/</a></p>
<h3 style="text-align: justify;">Atop</h3>
<p>Désolé, ca doit être le chocolat de paques, je fais une petite fixation sur les top en ce moment. Atop, c&#8217;est comme top, mais en plus sympa. Les process sont mieux triés, le package est disponible en debian stable, alors comment parler de trucs qui font des top sans parler d&#8217;atop ?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wikigento.com/optimisation-lampzendmagento/encore-quelques-outils-pour-optimiser-magento/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quelques optimisations Magento</title>
		<link>http://www.wikigento.com/admin-magento/quelques-optimisations-pour-magento/</link>
		<comments>http://www.wikigento.com/admin-magento/quelques-optimisations-pour-magento/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 08:21:58 +0000</pubDate>
		<dc:creator>Philippe Humeau</dc:creator>
				<category><![CDATA[Admin Magento]]></category>
		<category><![CDATA[Optimisation LAMP/Zend/Magento]]></category>
		<category><![CDATA[optimisation magento]]></category>
		<category><![CDATA[performance magento]]></category>
		<category><![CDATA[asynchronous]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[multithread]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[uri]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://www.wikigento.com/?p=2000</guid>
		<description><![CDATA[Quelques optimisations A la suite d&#8217;Imagine US et des technical tracks ainsi que de plusieurs lectures récentes, je vous propose quelques informations ou techniques que j&#8217;ai trouvé intéressantes. J&#8217;allais également oublier, les slides de ma conférence à Imagine sont disponibles ici et la vidéo a été mise en ligne ici. Zend asynchronous Lors des tech [...]]]></description>
			<content:encoded><![CDATA[<h1>Quelques optimisations</h1>
<p><BR></p>
<p style="text-align: justify;">A la suite d&#8217;Imagine US et des technical tracks ainsi que de plusieurs lectures récentes, je vous propose quelques informations ou techniques que j&#8217;ai trouvé intéressantes.</p>
<p>J&#8217;allais également oublier, les slides de <a title="Imagine Performance Track Slides" href="http://www.wikigento.com/wp-content/uploads/2011/03/Imagine_philippe_humeau.pdf">ma conférence à Imagine sont disponibles ici</a> et la <a href="http://www.youtube.com/watch?v=Gn_4Vpl4p2k&amp;feature=player_embedded">vidéo a été mise en ligne ici</a>.</p>
<h2>Zend asynchronous</h2>
<p>Lors des tech tracks d&#8217;Imagine, j&#8217;ai aussi pu voir le passionnant papier de Kevin de Zend. Le principe est de faire des requêtes qui seront servies de manière Asynchrone, ni plus ni moins qu&#8217;un Job manager en fait. actuellement je recommandais l&#8217;usage de Gearman pour la plupart de gestions de Queue mais quand on a pas besoin d&#8217;un fonctionnalité aussi avancé, Zend Asynchronous peut être une ressource à la fois simple et efficace.</p>
<p><a title="Zend Asynchronous" href="http://www.eschrade.com/page/implementing-asynchronous-functionality-magento-4d52d81d">Le papier de Kevin est disponible ici</a>.</p>
<h2>Mysql, ca ne se scale pas&#8230;</h2>
<p>On commence de plus en plus a avoir des sites énormes en hébergement. Que ce soit du Ecommerce ou des médias, un gros site va très clairement faire chauffer la base de données. Le soucis avec Mysql, largement reporté déjà mais visible entre autre dans <a title="Mysql multicore" href="http://lists.mysql.com/mysql/217114">ce thread sur le forum Mysql</a>, c&#8217;est que InnoDB et MyISAM se scale très très mal.</p>
<p>Quand on a un serveur qui a plus de 4 processeurs (plus de 4 cores pour être précis), Mysql ne sait pas en tirer partie. Pire, c&#8217;est même parfois un handicape. Alors en attendant la version 5.4 qui nous promet une refonte massive de l&#8217;architecture multi thread de Mysql, on va devoir faire avec. En plus, depuis le rachat de Sun par Oracle et la politique mené par ce dernier, doublé du mouvement NoSQL, il n&#8217;est pas certain qu&#8217;on voit un jour cette version.</p>
<p>Pire, avec Oracle derrière, le principe de limitation de Mysql pourrait même faire les affaires du titan qui aurait un intérêt évident à ne pas corriger ce point afin de vendre de l&#8217;Oracle.</p>
<p>Alors il reste le moyen de chainer les serveurs à 4 cores&#8230; Master/Master/Master etc. Ou de séparer les Read et Write et on fait un Master / Slave. Mais rien de bien brillant pour des sites qui consomment de plus en plus de ressources.</p>
<h2>La conception, encore et toujours</h2>
<h3>Shawan mon amour</h3>
<p style="text-align: justify;">On a eu un problème assez original il y a quelques semaines à NBS System. Un client a eu des soucis délirant de charge de sa base de données. Tout le monde s&#8217;est posé la question, Moooo gento ou problème plus technique ?</p>
<p style="text-align: justify;">Une première réponse au problème a été une découverte (faite par la web agency), d&#8217;un soucis atypique&#8230; Quand on fait un mailing pour une vente privée ou des clients existants, il est possible de les authentifier automatiquement quand ils suivent le lien. C&#8217;est très confortable pour eux et plusieurs systèmes existent qui facilitent la vie des intégrateurs.</p>
<p style="text-align: justify;">Oui mais&#8230;</p>
<p style="text-align: justify;">Quand on fait ca sur une très large clientèle, selon la façon de le faire, cela peut avoir des incidences très sensibles. L&#8217;exemple ici c&#8217;est que la base de données se retrouvait à décoder des centaines de Shawan (Hash SHA1) à la secondes au moment du pic d&#8217;ouverture des mailings. Résultat, à chaque clic, la DB devait décoder le SHA1 et vérifier son authenticité et &#8230; ca la cassait en deux.</p>
<p style="text-align: justify;">Ce travail doublé du travail normal de DB la mettait totalement à genoux. Une analyse des logs, des slow queries, des paramètres vitaux de serveurs et une collaboration entre l&#8217;infogérant (nous) et la web agency a permis de mettre un nom sur le problème et de le corriger. Vicieux celui-ci.</p>
<h3>Conception de Home</h3>
<p style="text-align: justify;">Bien concevoir sa home reste une clef du succès d&#8217;un site. La charge imposé par la Home sur l&#8217;ensemble de la charge serveur dépasse souvent les 40%, il est donc important de concevoir de manière optimale  cette page qui est le premier accueil qu&#8217;un client reçoit.</p>
<h4>Pleinnnnn de produits</h4>
<p>Eh oui ma bonne dame, plus y&#8217;en a, mieux c&#8217;est.</p>
<p style="text-align: justify;">Faux. Lisez ce qu&#8217;en penses mes amis les pros comme Capitaine Commerce, François Ziserman ou Catherine Barba, assommer les clients sous 200 produits en homepage, ca n&#8217;apporte rien sinon un client perdu. Et plus on charge de produits, plus on fait travailler la base de données et les CPU pour interpréter le PHP et plus&#8230; ca rame.</p>
<p>Donc on a des clients perdus sur un site qui rame. Êtes vous bien persuadé que c&#8217;est  ce que vous voulez ???<br />
(Press Y to continue if you are sure)</p>
<h4>Dynamique, non mieux, random !</h4>
<p>Bien tiens&#8230; J&#8217;ai une ligne de conduite précise, je sais ce que je vend et à qui. Aucun doute à ce sujet, j&#8217;ai profiler ma clientèle alors pour optimiser mes ventes, je charge mes produits en random&#8230;</p>
<p style="text-align: justify;">Alors je veux bien que dans certains cas cela puisse avoir, à l&#8217;occasion, du sens mais clairement pas en home et pas tout le temps. Amazon, notre maitre à tous, ils envoient pas des produits en random à leurs clients. Ce qui a boosté leurs ventes et surtout le panier moyen de chaque acheteurs, c&#8217;est tout l&#8217;inverse, c&#8217;est l&#8217;envoie de produits ciblés.</p>
<p style="text-align: justify;">Alors charger dynamiquement oui, dans certain cas pour s&#8217;adapter au client mais en random&#8230; ?</p>
<p style="text-align: justify;">Car oui, le random et le dynamique sont des ennemis des caches, ces fameux caches (reverse proxy, celui de votre system de e-commerce, memcached, le Full Page  Cache et dans une moindre mesure celui des processeurs et des opcode cache de PHP) sont assez allergiques au hasard.</p>
<h4>Et le statique ?</h4>
<p style="text-align: justify;">Vous y avez pensé ? Une landing statique bien faite, qui a la calculer chaque nuit en Cron, ca peut faire la différence. Sincèrement, afficher moins et mieux pour fournir à tout le monde une expérience utilisateur plus fluide, efficace et rapide, c&#8217;est une stratégie payante.</p>
<p style="text-align: justify;">Plus votre site est véloce, plus et mieux il vend, c&#8217;est plus que démontré.</p>
<h2>Inline URI</h2>
<p>Alors celui-ci de tricks, il est soooo sexy.</p>
<p>Il faudrait tester en live la chose et étudier si c&#8217;est rentable mais le principe est marrant. En gros, dans votre CSS, plutot que de mettre la référence à une image externe, vous allez mettre en place une  chaine de caractère encodée en base64 :</p>
<p>url(data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7)</p>
<p>Ca donne un texte certe un peu chargé mais&#8230; Le Gzip est là pour nous aider. En gros le CSS va grossir, certes mais en contrepartie on peut le compresser en mod_gzip ou mod_deflate et finalement on n&#8217;a qu&#8217;une légère augmentation. Par contre, on économise autant de GET HTTP, ce qui n&#8217;est pas négligeable.</p>
<p>A vue de nez, je pense qu&#8217;il est valable de le faire pour les petites images, icones ou petits thumbnails. Il est possible aussi de faire un Sprite bien sûr, mais cette  technique alternative peut aussi avoir ses cotés sympas. Je dois avouer que c&#8217;est tout neuf pour moi alors je n&#8217;ai pas penssé à tous les points qui pourraient profiter des ces Data URIs.</p>
<p>(Beaucoup) plus d&#8217;infos sur cette technique ici : <a href="http://css-tricks.com/data-uris/">http://css-tricks.com/data-uris/</a></p>
<h2></h2>
]]></content:encoded>
			<wfw:commentRss>http://www.wikigento.com/admin-magento/quelques-optimisations-pour-magento/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Optimiser les imports dans Magento</title>
		<link>http://www.wikigento.com/optimisation-lampzendmagento/optimiser_imports_magento/</link>
		<comments>http://www.wikigento.com/optimisation-lampzendmagento/optimiser_imports_magento/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 16:36:08 +0000</pubDate>
		<dc:creator>Philippe Humeau</dc:creator>
				<category><![CDATA[Optimisation LAMP/Zend/Magento]]></category>
		<category><![CDATA[base donnée]]></category>
		<category><![CDATA[Innodb_flush_log_at_trx_commit]]></category>
		<category><![CDATA[my.cnf]]></category>
		<category><![CDATA[optimisation]]></category>

		<guid isPermaLink="false">http://www.wikigento.com/?p=1890</guid>
		<description><![CDATA[Magento et les imports Comme souvent, quand vous avez un site Web à faire tourner ou à lancer, vous aller envisager de faire des imports. Que ce soit un one-time ou une automatisation, vous aller vivre avec une limitation de rapidité. Celle-ci est dûe en partie à la structure de la base en EAV et [...]]]></description>
			<content:encoded><![CDATA[<h1>Magento et les imports</h1>
<p></p>
<p style="text-align: justify;">Comme souvent, quand vous avez un site Web à faire tourner ou à lancer, vous aller envisager de faire des imports. Que ce soit un one-time ou une automatisation, vous aller vivre avec une limitation de rapidité. Celle-ci est dûe en partie à la structure de la base en EAV et au fonctionnement du Framework.</p>
<p style="text-align: justify;">Cette limite vous borne à un rythme de un a deux secondes par produits à 10/20 produits par secondes selon la méthode utilisée, la machine et la complexité de l&#8217;import.</p>
<p style="text-align: justify;">Dès que l&#8217;on touche à une grande masse, gagner un peu va jouer beaucoup au final.</p>
<h1>Vitaminer un peu vos bases</h1>
<p></p>
<h2>Désactiver les binlogs</h2>
<p style="text-align: justify;">Ce tips est utilisable aussi bien pendant vos imports que sur votre production. Seul petit soucis, sur la production, désactiver les binlogs va vous empécher de faire du master/master ou du master/slave (peut être du cluster je ne sais pas) et ca peut ne pas coller avec vos besoins.</p>
<p style="text-align: justify;">Dans votre fichier my.cnf, pour désactiver les binlogs, vous pouvez passer la ligne <strong>sync_binlog=1</strong> à <strong>sync_binlog=0</strong>.</p>
<p style="text-align: justify;">C&#8217;est typiquement utile/faisable pour un mono serveur dédié ou virtualisé avec base de donnée et frontal web sur la même instance/machine.</p>
<h2>Innodb_flush_log_at_trx_commit</h2>
<p style="text-align: justify;">Deuxième limite, si vous passer la paramètre innodb_flush_log_at_trx_commit à 2, vous aller limiter votre niveau de protection en cas de crash et encore, nous parlons ici de la dernière seconde de transaction. Vos machines sont censées être au chaud dans un datacenter, redondante et un crash arrive très très rarement. Une seconde de transaction, chez vente privée à 8h00 du matin, ca peut faire très mal, mais sur un site un peu plus raisonnable à minuit, ca ne représente en général rien. Le risque est donc très limité, d&#8217;autant que de nombreux hoster mette maintenant ce paramètre par défaut.</p>
<p style="text-align: justify;"><span style="text-decoration: underline;">La doc de Mysql nous dit :<br />
</span><em>If the value of innodb_flush_log_at_trx_commit is 0, the log buffer is written out to the log file once per second and the flush to disk operation is performed on the log file, but nothing is done at a transaction commit. </em><em>When the value is 1, the log buffer is written out to the log file at each transaction commit and the flush to disk operation is performed on the log file. </em></p>
<p style="text-align: justify;"><em>When the value is 2, the log buffer is written out to the file at each commit, but the flush to disk operation is not performed on it. However, the flushing on the log file takes place once per second also when the value is 2. Note that the once-per-second flushing is not 100% guaranteed to happen every second, due to process scheduling issues.</p>
<p></em><em>With a value of 2, then only an operating system crash or a power outage can erase the last second of transactions. However, InnoDB&#8217;s crash recovery is not affected and thus crash recovery does work regardless of the value.<br />
</em></p>
<p style="text-align: justify;">Il faut savoir que les disques durs et les controlleurs peuvent aussi prendre sur eux de retourner un joyeux &laquo;&nbsp;ok c&#8217;est fait&nbsp;&raquo; alors qu&#8217;en fait, la donnée est en cache mémoire en attendant un flush&#8230; Mais dans ce cas, le mode 1 n&#8217;est pas plus sécurisant, donc autant rester sur le 2.</p>
<p style="text-align: justify;"><span style="text-decoration: underline;">Pour modifier votre valeur de commit :<br />
</span>passer <strong>innodb_flush_log_at_trx_commit = 1</strong> à <strong>2</strong></p>
<h2>Résultats attendus</h2>
<p style="text-align: justify;">Si vous mettez ces deux valeurs en place, vous devriez avoir un gain de performances pour vos imports mais aussi en exploitation, de 20 à 40% de performances. C&#8217;est un choix à bien réfléchir cependant mais un risque limité. Coté binlog, c&#8217;est faisable ou non, tout dépend de votre environnement.</p>
<p style="text-align: justify;">
<p style="text-align: justify;">
]]></content:encoded>
			<wfw:commentRss>http://www.wikigento.com/optimisation-lampzendmagento/optimiser_imports_magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backend et systèmes de cache Magento</title>
		<link>http://www.wikigento.com/optimisation-lampzendmagento/backend-de-cache-magento/</link>
		<comments>http://www.wikigento.com/optimisation-lampzendmagento/backend-de-cache-magento/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 16:01:23 +0000</pubDate>
		<dc:creator>Philippe Humeau</dc:creator>
				<category><![CDATA[Optimisation LAMP/Zend/Magento]]></category>
		<category><![CDATA[backend]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[fast cache]]></category>
		<category><![CDATA[magento fast backend]]></category>
		<category><![CDATA[magento slow backend]]></category>

		<guid isPermaLink="false">http://www.wikigento.com/?p=1873</guid>
		<description><![CDATA[Magento : un cache capricieux ? Voici un petit article composé suite à des recherches menées conjointement par NBS System et la Magento Academy. En effet, le directeur de production (Emile pour les intimes) a touver un comportement étrange lors du paramétrage des systèmes Magento &#62; 1.4.0. Avec l&#8217;apparition du slow backend, on avait en [...]]]></description>
			<content:encoded><![CDATA[<h1 style="text-align: justify">Magento : un cache capricieux ?</h1>
<p><BR></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Voici un petit article composé suite à des recherches menées conjointement par NBS System et la Magento Academy.</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">En effet, le directeur de production (Emile pour les intimes) a touver un comportement étrange lors du paramétrage des systèmes Magento &gt; 1.4.0. Avec l&#8217;apparition du slow backend, on avait en effet des résultats beaucoup plus &laquo;&nbsp;slow&nbsp;&raquo;.</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Fabrice nous a proposé d&#8217;élucider certains mystères en allant faire de l&#8217;inspection de code. Voici les premiers retours : </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<h1>Magento 1.4 : Changement du système de cache</h1>
<p><BR></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Depuis la version 1.4 de Magento un nouveau système gérant le cache à été mis en place appelé cache à 2 niveaux.</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Le premier niveau appelé <strong>fast backend</strong> est un cache rapide et est le cache principal et l</span></span><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">e second niveau, le <strong>slow backend</strong> et est un cache de secours en cas d&#8217;indisponibilité ou de saturation du cache de premier niveau. </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">L’utilisation de ce Slow Backend est imposé dès qu’un cache de premier niveau dit « rapide » est configuré.</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Autrement dis même si vous ne configurez rien en slow backend, le simple fait d’utiliser <strong>APC, Memcached, Xcache ou Eaccelerator</strong> activera le cache de second niveau avec pour type un file cache.</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<h2>Configurer son cache correctement</h2>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Magento attends comme valeurs de configuration dans le fichier <strong>local.xml</strong> les nœuds suivants :</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<pre><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"><em>&lt;backend /&gt; pour le fast backend</em></span></span></pre>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"><em> </em></span></span></p>
<pre><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"><em>&lt;slow_backend /&gt; pour le slow backend</em></span></span></pre>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Magento attends normalement les valeurs suivantes (attention à la case) pour le noeud <strong>&lt;backend</strong><strong>&gt;</strong> :</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<ul>
<li style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">file</span></span></li>
<li style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">sqlite </span></span></li>
<li style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">memcached</span></span></li>
<li style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">apc</span></span></li>
<li style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">xcache</span></span></li>
<li style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">eaccelerator</span></span></li>
<li style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">database</span></span></li>
</ul>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Toutefois pour le noeud <strong>&lt;slow_backend</strong><strong>&gt;</strong> Magento attends les valeurs suivantes </span></span><strong><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"><span style="text-decoration: underline;">sous peine de plantage</span></span></span></strong><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> (attention à la case) :</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<ul>
<li style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">File</span></span></li>
<li style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Sqlite</span></span></li>
<li style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> Memcached</span></span></li>
<li style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> Apc, Xcache</span></span></li>
<li style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> Varien_Cache_Backend_Eaccelerator</span></span></li>
<li style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> Varien_Cache_Backend_Database</span></span></li>
</ul>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Un bug semble présent dans l’Admin quand le système de cache à 2 niveaux est présent, en effet dans Système &gt; Gestion du cache, tous les caches semblent désactivé même s’ils le sont bien, il semble que ce soit un bug qui peut être corrigé facilement (même si l&#8217;on vous déconseille de patcher le Core a moins d&#8217;en avoir un suivi très précis) :</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Dans le fichier <em>app/code/core/Mage/Core/Model/Cache.php</em></span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<pre><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Méthode _initOptions()
</span></span></pre>
<pre><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">La ligne
</span></span></pre>
<pre><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">if ($options === false) {
</span></span></pre>
<pre><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">  devrait être
</span></span></pre>
<pre><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">if ($options === false || $options === null) {</span></span></pre>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Toutefois ce bug ne semble se manifester que si le cache APC est plein.</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Ce cache APC d&#8217;ailleurs se remplit en continue et n&#8217;est pas &laquo;&nbsp;rafraichit&nbsp;&raquo; assez vite, ce qui fait qu&#8217;on tombe vite dans le slow backend qui, s&#8217;il n&#8217;est pas configuré, atterrit sur les disques dur (ou en RAMdisk si vous en avez paramétré). Il reste possible de le nettoyer en l&#8217;effaçant mais ce n&#8217;est pas optimal.</span></span><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<h2>Des arbitrages déroutants</h2>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Magento vérifie si le cache a suffisamment de place libre avant de faire les mises en cache. Pour APC c’est la consommation de mémoire qui est vérifiée, sur le taux d’utilisation dépasse 80% le cache APC est ignoré. Déjà, 80% de 64 Mo ou de 1 Go ce n&#8217;est pas la même chose, pourquoi ne pas mettre un seuil en Mégas plutôt qu&#8217;en pourcentage ?</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">A l’écriture Magento écrit dans APC à l’unique condition que son taux d’utilisation soit <strong>inférieur à 80%</strong>, dans tous les cas il écrira dans le slow backend.</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">A la lecture seul le </span></span><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">fast backend</span></span><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> est utilisé, s’il n’existe pas ou n’est pas disponible Magento lira dans le slow_backend</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Notez que le cache à 2 niveau possède une option <strong>auto_refresh_fast_cache</strong> il semble bizarre car il ne fait que remettre en cache les données chargées depuis le cache repoussant ainsi sa date d’expiration, cela ne se fait que si le taux d’utilisation du cache est &lt; 80%.</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<h1 style="text-align: justify">Conclusion sur le cache Magento 1.4+</h1>
<p><BR></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">L’écriture du slow backend est donc systématique mais ne se fait que si le fast backend doit écrire lui aussi, donc si tu ouvre une page le slow et le fast backend sont générés. Si par la suite on supprime les fichiers du slow_backend mais pas du fast, les fichier du slow backend ne seront régénéré que si le fast backend l’est aussi. Tant que le fast backend a un cache valide les fichier du slow backend ne sont pas régénérés.</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Il n&#8217;y a donc pas de bugs majeurs dans la configuration, elle est juste un peu subtile à comprendre et non documenté ce qui n&#8217;aide pas. Par contre, le principe de l&#8217;utilisation du Fast et son taux de renouvellement trop faible en font un système moins efficace puisque le Fast est presque tout le temps plein, des données les plus anciennes.</span></span></p>
<p style="text-align: justify"><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;"> </span></span><span style="font-family: &quot;arial&quot;, &quot;helvetica&quot;, sans-serif;"><span style="font-size: small;">Merci à Emile pour la piste et Fabrice pour l&#8217;analyse.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wikigento.com/optimisation-lampzendmagento/backend-de-cache-magento/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Optimisation de sites Magento (et autres) !</title>
		<link>http://www.wikigento.com/optimisation-systeme-reseau/optimisation-de-sites-magento/</link>
		<comments>http://www.wikigento.com/optimisation-systeme-reseau/optimisation-de-sites-magento/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 17:28:55 +0000</pubDate>
		<dc:creator>Philippe Humeau</dc:creator>
				<category><![CDATA[Optimisation LAMP/Zend/Magento]]></category>
		<category><![CDATA[Optimisation Système & Réseau]]></category>
		<category><![CDATA[css optimiser]]></category>
		<category><![CDATA[optimisation de site]]></category>
		<category><![CDATA[optimisation de site magento]]></category>
		<category><![CDATA[optimisation pagespeed]]></category>
		<category><![CDATA[optimisation Yslow]]></category>

		<guid isPermaLink="false">http://www.wikigento.com/?p=1523</guid>
		<description><![CDATA[Introduction Beaucoup de principes sont généraux à tous les frameworks, qu&#8217;ils s&#8217;agissent d&#8217;un site Magento, Prestashop, WordPress, Drupal, etc&#8230; Certains Framework ou plugins de ces solutions vous aident nativement à le faire, d&#8217;autre n&#8217;ont pas cette possibilité ou cette richesse en stock. J&#8217;ai récemment refais le site de NBS System (ma société) de A à [...]]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p style="text-align: justify">Beaucoup de principes sont généraux à tous les frameworks, qu&#8217;ils s&#8217;agissent d&#8217;un site Magento, Prestashop, WordPress, Drupal, etc&#8230; Certains Framework ou plugins de ces solutions vous aident nativement à le faire, d&#8217;autre n&#8217;ont pas cette possibilité ou cette richesse en stock.</p>
<p style="text-align: justify">J&#8217;ai récemment refais le site de <a title="Hébergement de sites E-commerce" href="http://www.nbs-system.com/hebergement-infogerance/e-commerce/hebergement-magento/">NBS System</a> (ma société) de A à Z avec nos amis de l&#8217;<a href="http://www.dnd.fr/">agence DnD</a> et forcément, on s&#8217;est un peu intéressés à l&#8217;optimisation. C&#8217;est un chemin complexe mais passionnant alors autant vous faire partager quelques trouvailles dans le domaine.</p>
<p style="text-align: justify">Je ne reviens pas sur le pourquoi, optimiser c&#8217;est bien, améliorer l&#8217;expérience utilisateur c&#8217;est bien, avoir un meilleur référencement naturel car on charge vite, c&#8217;est bien. De toute façon vous surfez sur un Blog, il faudra bien justifier cela à votre boss un jour donc on va dire que c&#8217;est pour le bien d&#8217;Internet et la préservation de la bande passante.</p>
<p>Après en société, vous pourrez faire les malins et expliquer qu&#8217;en optimisant votre site, vous avez participer à éviter l&#8217;<a href="http://www.lesechos.fr/info/comm/020289856641.htm">Exaflood</a>, ca ne fait pas tomber les femmes mais coté entretient d&#8217;embauche, sur un malentendu, vous forcerez l&#8217;admiration.</p>
<h1>Comment Analyser</h1>
<p style="text-align: justify">Nos deux amis : <a title="utiliser Yslow" href="https://addons.mozilla.org/en-US/firefox/addon/5369">Yslow</a> et <a title="Utiliser Pagespeed" href="http://code.google.com/speed/page-speed/download.html">PageSpeed</a>. Ces deux plugins fonctionnent sous Firefox et vous donnent un point de vu sur ce qui est propre, bien fait et ce qui ne l&#8217;est pas. Pagespeed, celui de Google, est plus nouveau et un poil plus complet, il tourne évidemment aussi sous Chrome. Yslow est celui fournit par Yahoo depuis des années, il est très intéressant également, personnellement, j&#8217;utilise les deux.</p>
<p>Je vous conseil aussi le site <a href="http://analyze.websiteoptimization.com/">websiteoptimization</a> qui vous donnera aussi de préciseuses infos. Evidemment, passer sans erreur le <a title="W3C Xhtml Validator" href="http://validator.w3.org/">XHTML validator</a> est important également, même si c&#8217;est pas toujours simple.</p>
<p style="text-align: justify">En complément, je me dois de citer l&#8217;excellent site <a title="GT Metrix" href="http://www.gtmetrix.com">www.gtmetrix.com</a>. Pour ceux qui comme moi utilisent Opera ou qui ont un browser exotique et qui n&#8217;ont pas nativement ces plugins, c&#8217;est bien utile d&#8217;avoir à la fois Yslow et Pagespeed au même endroit, dans une même page.</p>
<p style="text-align: center"><strong>Pagespeed :</strong><br />
<a rel="attachment wp-att-1524" href="http://www.wikigento.com/optimisation-systeme-reseau/optimisation-de-sites-magento/attachment/pagespeed/"><br />
<img class="size-medium wp-image-1524 aligncenter" title="pagespeed screenshot" src="http://www.wikigento.com/wp-content/uploads/2010/07/pagespeed-500x388.jpg" alt="pagespeed screenshot" width="500" height="388" /></a></p>
<p style="text-align: center"><strong>Yslow :</strong><br />
<a rel="attachment wp-att-1525" href="http://www.wikigento.com/optimisation-systeme-reseau/optimisation-de-sites-magento/attachment/yslow/"><br />
<img class="size-medium wp-image-1525 aligncenter" title="yslow screenshot" src="http://www.wikigento.com/wp-content/uploads/2010/07/yslow-500x391.jpg" alt="yslow screenshot" width="500" height="391" /></a></p>
<p style="text-align: center"><strong>GT Metrix :</strong><br />
<a rel="attachment wp-att-1526" href="http://www.wikigento.com/optimisation-systeme-reseau/optimisation-de-sites-magento/attachment/gtmetrix/"><br />
<img class="size-medium wp-image-1526 aligncenter" title="gtmetrix" src="http://www.wikigento.com/wp-content/uploads/2010/07/gtmetrix-500x384.jpg" alt="gtmetrix" width="500" height="384" /></a></p>
<h1>Lire les résultats</h1>
<p style="text-align: justify;">Evidemment le but est atteindre le rating maximum, soit A/A ou 100%/100%.</p>
<p>C&#8217;est pour ainsi dire impossible donc si on peut aller à une note très intéressante, ca sera déjà pas mal. Ceci va en plus réduire le temps de chargement de la page et donc nous faire passer sous la barre d&#8217;1,5 seconde et donc améliorer la façon dont nous considère Google.</p>
<p>Dans l&#8217;immédiat, on voit que Pagespeed à un peu plus de critères mais on retrouve 70% de points communs soit une forme ou une autre alors je vais les grouper par types.</p>
<h2>Pagespeed : &laquo;&nbsp;Parallelize downloads across hostnames&nbsp;&raquo;<br />
Yslow : Use Cookie-free domains<br />
Pagespeed : Serve static content from a cookieless domain</h2>
<p style="text-align: justify;">C&#8217;est quasi comparable, dans le principe il s&#8217;agit de permettre aux browsers qui viennent de télécharger vos contenus de sites depuis plusieurs serveurs distincts afin de leur permettre d&#8217;établir plus de connexions simultannées. En gros, pour ne pas saturer les serveurs, les browser ne s&#8217;authorise que 6 à 15 connexions vers un même serveur, c-a-d qu&#8217;ils ne téléchargent que 6 à 15 éléments simultanéments et attendent pour demande les suivants que des connexions se libèrent.</p>
<p style="text-align: justify;">C&#8217;est paramétrable du coté du client, sur le navigateur mais on ne va pas demander à chacun de modifier son paramétrage de navigateur donc il vaut mieux utiliser plusieurs serveurs, quand cela est possible, pour servir le contenu, notamment static. Ici, seul le hostname compte, vous pouvez avec le même serveur physique derrère un www1, www2 etc&#8230;</p>
<p style="text-align: justify;">Avoir 4 serveurs qui distribuent le contenu va permettre aux navigateurs d&#8217;aller beaucoup plus vite pour récupérer les contenus. Un petit regret ici, il aurait été plus simple d&#8217;intégrer un variable sur le nombre de thread concourrant accepté directement dans le handshake http 1.1. Ca aurait permis d&#8217;accélérer en basse charge et de diminuer pendant les pics. On peut aller plus loin aussi en servant depuis plusieurs endroits, sur un domaine différents &laquo;&nbsp;cookieless&nbsp;&raquo;.</p>
<p style="text-align: justify;">Ce n&#8217;est pas très compliqué à faire en réalité. Le plus simple c&#8217;est d&#8217;enregistrer un nom domaine différent de celui du site, par exemple static-nbs-system.com et de mettre un CNAME dans la zone DNS qui pointe sur l&#8217;enregistrement A du site (en l&#8217;occurence nbs-system.com). Ensuite on configure le service web pour fournir les ressources statiques depuis ce nouveau domaine, on interdit de poser les cookies sur ce domaine et dans les pages web on appelle les ressources statiques sur ce domaine. On peut bien sûr reproduire le schéma avec n host sur ce nouveau domaine, static1.blablabla, static2.blablabla etc&#8230;</p>
<p style="text-align: justify;">Ca à l&#8217;air bien sur le papier mais si le framework le gère pas, il va falloir éditer des fichiers de config, des fichiers php ou HTML ou encore jouer de la commande sed pour automatiser le remplacement de l&#8217;url. (<a title="manuel de survie Unix" href="http://www.wikigento.com/general/manuel-de-survie-unix-linux-2°-partie/">pour sed, vous pouvez voir l&#8217;article ici</a>)</p>
<p style="text-align: justify;">Je ne sais pas si ca à une influence sur la SEO par contre. Vu que le nom et l&#8217;URL des ressources statiques participe à la SEO on m&#8217;a dit, je ne sais pas l&#8217;impacte.<br />
Faible je suppose vu que ce sont des plugins de moteurs de recherche qui conseillent ce mouvement&#8230; Un pro de la SEO pour m&#8217;éclairer ?</p>
<h2>Yslow : &laquo;&nbsp;Use a Content Delivery Network (CDN)&nbsp;&raquo;</h2>
<p style="text-align: justify">L&#8217;idée est un peu la même mais à une petite nuance prêt. Yslow conseil l&#8217;usage d&#8217;un CDN de manière absolu, un qui soit connu pour le reprérer. Pagespeed lui conseille de multiplier les sources servant les fichiers. L&#8217;idée de fond reste proche, servir le plus vite possible les éléments, depuis des sources spécialisées. Soit vous prenez un CDN connu (Akamai, limewire etc&#8230;) soit votre prestataire à le sien, soit vous en <a title="Liste de CDN" href="http://fr.wikipedia.org/wiki/Content_Delivery_Network#CDNs_Gratuits">prenez un gratuit</a>.</p>
<p>Dans les deux derniers cas, Yslow ne connaitra probablement pas votre CDN et vous devrez malgré tout trainer une mauvaise note sur ce sujet&#8230; Ca n&#8217;empêche pas d&#8217;avoir un A cependant car pour Yslow, c&#8217;est un point moyennement important. Et puis soyons honnête, avoir un CDN (Content Delivery Network) ce n&#8217;est utile que pour des sites qui servent à destinations de plusieurs pays distants, dans la majorité des cas, un serveur de ressources statiques suffit.</p>
<h2>Yslow : &laquo;&nbsp;Add Expire headers&nbsp;&raquo;,<br />
Pagespeed : &laquo;&nbsp;Leverage Browser Caching&nbsp;&raquo;</h2>
<p style="text-align: center">
<p style="text-align: justify">Ca joue beaucoup, ca compte beaucoup et, bonne nouvelle : c&#8217;est facile à faire !</p>
<p style="text-align: justify">Avec Apache, un petit tour dans la configuration, on ajoute le mod Expire et le mode Etags et on met les lignes de configurations suivantes :</p>
<p style="text-align: justify">LoadModule expires_module /usr/lib/apache2/modules/mod_expires.so<br />
ExpiresActive On</p>
<pre>FileETag MTime Size</pre>
<pre>&lt;IfModule mod_expires.c&gt;
 ExpiresActive on
 ExpiresByType image/jpg "access plus 6 months"
 ExpiresByType image/jpeg "access plus 6 months"
 ExpiresByType image/gif "access plus 6 months"
 ExpiresByType image/png "access plus 6 months"
 ExpiresByType text/ico "access plus 6 months"
 ExpiresByType image/ico "access plus 6 months"
 ExpiresByType image/icon "access plus 6 months"
 ExpiresByType image/x-icon "access plus 6 months"
 ExpiresByType application/x-shockwave-flash "modification plus 6 months"
 ExpiresByType text/css "access plus 1 week"
 ExpiresByType text/javascript "access plus 1 week"
 ExpiresByType text/html "modification plus 1 week"
 ExpiresByType text/xml "modification plus 2 hours"
 ExpiresByType image/vnd.microsoft.icon "access plus 6 months"
 ExpiresDefault "access plus 1 week"
 #Header set Cache-Control "max-age=86400, public"
&lt;/IfModule&gt;</pre>
<pre>&lt;FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$"&gt;
 Header set Cache-Control "max-age=290304000, public"
&lt;/FilesMatch&gt;</pre>
<p style="text-align: justify">Voila, on a indiqué à Apache qu&#8217;on calculait la fraicheur d&#8217;une ressource en fonction de la date d&#8217;accès et de sa taille  (FilteEtag MTime  Size) et ensuite on lui a donné, par type de ressources, un temps d&#8217;expiration du cache. En résumé, quand votre navigateur récupère une donnée, il a le droit de la garder 6 mois si c&#8217;est un jpg par exemple, 1 semaine si c&#8217;est un javascript.</p>
<p style="text-align: justify">Evidemment, il faut le paramétrer en fonction de votre site et de la fréquence à laquelle vous mettez vos éléments à jour. Enfin, autre format, les 3 dernières lignes mettent une expiration à 480 semaines par défaut sur les ressources du type cité.</p>
<p style="text-align: justify">Si vous développez, il est fortement conseillé d&#8217;avoir une préproduction sur laquelle vous n&#8217;avez pas ces lignes, afin d&#8217;avoir le résultats de vos modifications instantanément et pas 480 semaines plus tard <img src='http://www.wikigento.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: justify">Les deux plugins considèrent, à juste titre, que c&#8217;est un point important.</p>
<h2>Yslow : Compress components with Gzip<br />
Pagespeed : Enable Gzip compression</h2>
<p style="text-align: justify">Il peut y avoir un peu débat sur celui-là, et encore. En gros le débat serait que sur un serveur dont le CPU est chargé, faire du Gzip en plus, ca aggrave le problème&#8230; Oui et non. Déjà, l&#8217;algorithme Zip est ultra rapide et optimisé, ca prends très peu de ressources à processeur moderne. En plus, servir plus vite c&#8217;est aussi diminuer sa charge de travail quelque part (on peut traiter plus de monde).</p>
<p style="text-align: justify">Coté débat, nous chez NBS, en matière de serveur E-commerce, on a tranché, c&#8217;est oui.</p>
<pre>&lt;IfModule mod_php5.c&gt;
   php_flag zlib.output_compression on
&lt;/IfModule&gt;</pre>
<pre>&lt;IfModule mod_deflate.c&gt;
 SetOutputFilter DEFLATE
 AddOutputFilterByType DEFLATE text/*
 DeflateFilterNote ratio
# Patch pour les navigateurs qui ne supportent pas
 BrowserMatch ^Mozilla/4 gzip-only-text/html
 BrowserMatch ^Mozilla/4\.0[678] no-gzip
 BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Humm compresser les images, ce n'est pas utile, loin de là
 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
 SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
 SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
&lt;/IfModule&gt;</pre>
<p style="text-align: justify">Bon, c&#8217;est assez simple et explicite, on compresse tout ce qui est textuel, on désactive pour les vieux Mozilla 4 et les IE, on ne compresse pas les images.</p>
<p style="text-align: justify">Ca réduit bien les transferts mine de rien :</p>
<p style="text-align: justify">
<tr height="20">
<td width="77" height="20">Type</td>
<td width="98">Uncompressed</td>
<td width="84">Compressed</td>
<td width="57">Win</td>
</tr>
<tr height="20">
<td height="20">doc / HTML</td>
<td align="right">44,5</td>
<td align="right">14,8</td>
<td align="right">67%</td>
</tr>
<tr height="20">
<td height="20">js</td>
<td align="right">25,1</td>
<td align="right">10,4</td>
<td align="right">59%</td>
</tr>
<tr height="20">
<td height="20">js</td>
<td align="right">57,2</td>
<td align="right">19,7</td>
<td align="right">66%</td>
</tr>
<tr height="20">
<td height="20">js</td>
<td align="right">0,9</td>
<td align="right">0,4</td>
<td align="right">56%</td>
</tr>
<tr height="20">
<td height="20">js</td>
<td align="right">90,4</td>
<td align="right">29,8</td>
<td align="right">67%</td>
</tr>
<tr height="20">
<td height="20">js</td>
<td align="right">17,4</td>
<td align="right">8,1</td>
<td align="right">53%</td>
</tr>
<tr height="20">
<td height="20">css</td>
<td align="right">30,9</td>
<td align="right">6</td>
<td align="right">81%</td>
</tr>
<tr height="20">
<td height="20"></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr height="20">
<td height="20">économie</td>
<td align="right">177,2</td>
<td>Ko</td>
<td align="right">33%</td>
</tr>
<p style="text-align: justify">C&#8217;est tangible et appréciable, ca économise de la bande passante des deux cotés, c&#8217;est tout bon !</p>
<h2>Yslow : Minify Javascript and CSS<br />
Yslow : Remove duplicate Javascript and CSS<br />
Pagespeed : Combine   external JavaScript<br />
Pagespeed : Minify Javascript<br />
Pagespeed : Removed unused CSS<br />
Pagespeed : Minify CSS<br />
Pagespeed : Combine external CSS</h2>
<p>Okay, ca fait beaucoup d&#8217;un coup mais c &#8216;est la même logique derrière.</p>
<p style="text-align: justify;">Le principe de fond : on regroupe les CSS et les Javascript en deux fichiers au lieu de 15, on les nettoye des bouts de codes ou expressions non utilisées, on les &laquo;&nbsp;minify&nbsp;&raquo; (on les densifie, on enlève les espaces et les choses inutiles).</p>
<p>L&#8217;idée est bonne mais ca fait un code peu maintenable, alors le conseil du pro : on fait son site sur la préproduction et on se fait un script bash de mise en production qui fait le ménage et compacte  le tout au moment de la mise en production. Comme cela, on a une préproduction qui reste efficace à maintenir avec des fichiers lisibles et un production optimisée.</p>
<p style="text-align: justify;">Pour réaliser ces optimisations, deux possibilités voir même beaucoup plus. Pagespeed à la gentillesse de fournir certains fichiers optimisés directement depuis le plugin. On le sauve, on le met sur la production et hop, c&#8217;est finit. Pour optimiser ses CSS on a aussi le site <a title="CSS optimiser" href="http://www.cssoptimiser.com/">cssoptimiser</a> ou le <a title="CSS cleaning" href="http://www.cleancss.com/">cssclean</a>. Bref ce ne sont pas les outils qui manquent. Pour les combiner, ca dépend de la technologie, sous Magento on a Fooman speedster, sous WordPress il y a CSS-JS-Booster de mémoire, parfois vous devrez tout simplement le faire à la main.</p>
<p>Evidemment enlever le code inutile des JS et/ou des CSS, c&#8217;est un impératif.</p>
<p style="text-align: justify;">En réduisant le nombre de fichiers, on réduit le nombres de requêtes HTTP, on économise des transferts, de l&#8217;overhead, bref, là encore c&#8217;est du tout bon.</p>
<p style="text-align: justify;">Personnellement, j&#8217;ai massivement utilisé les fichiers directement issus de Pagespeed quand il m&#8217;en proposait, c&#8217;est parfait.</p>
<p style="text-align: justify;">La plupart du temps, ces modifications sont considéré comme importantes par les plugins.</p>
<h2>Yslow : Avoid CSS expressions<br />
Pagespeed : Use efficient CSS Selectors</h2>
<p style="text-align: justify">J&#8217;ai regroupé ces deux là car ils touchent aux CSS et à leur optimisation. C&#8217;est un réel enjeu car les navigateurs se débrouillent plus ou moins bien avec les CSS et cela peut engendrer des délais du coté de l&#8217;utilisateur.</p>
<p>Yahoo Yslow nous dit d&#8217;éviter les expressions CSS, ce qui permet de changer dynamiquement un CSS si le browser est redimensionné par exemple. Le problème c&#8217;est que ces expressions sont appelées tout le temps, pendant la génération de l&#8217;affichage, au redimensionnement, parfois pendant le scrolling. Du coup ca charge un maximum le navigateur client. Ceci étant tous les frameworks ou presque évite ca comme la peste, vous ne devriez pas avoir de soucis avec. Sinon, il faut s&#8217;en passer et réécrire les portions du CSS qui utilisait ce système.</p>
<p style="text-align: justify">Google Pagespeed nous indique pour sa part qu&#8217;il est préférable d&#8217;utiliser des CSS selector efficaces. Ouiiiiiii, c&#8217;est à dire qu&#8217;on est pas contre, mais c&#8217;est quoi la différence entre un bon et un mauvais CSS selector ? C&#8217;est comme la chasse. Le bon chasseur, il voit&#8230; okay&#8230; on reprend.</p>
<p style="text-align: justify">Le but c&#8217;est d&#8217;éviter d&#8217;appliquer une clef de sélection peu efficace à un grand nombre d&#8217;éléments car cela pénalise les performances du navigateur. Mais cela va plus loin c&#8217;est plus une connaissance générale de la grammaire CSS qu&#8217;il faut avoir.</p>
<p style="text-align: justify"><span style="text-decoration: underline;">Par exemple, il vaut mieux :</span></p>
<ul>
<li style="text-align: justify">utiliser une classe pour appliquer un style à de nombreux élements</li>
<li style="text-align: justify">privilégier le mécanisme d&#8217;héritage</li>
<li style="text-align: justify">utiliser des règles spécifiques</li>
<li style="text-align: justify">utiliser des class et ID plutot que des sélecteur de type Tag</li>
<li style="text-align: justify">éviter les qualificateurs redondants (ex : ID selectors par class et class selectors qualifiés par un tag selector)</li>
<li style="text-align: justify">éviter les sélecteurs descendants, surtout pour ceux qui pointe des ancêtres redondants (par exemple bidy ul li a {&#8230;} est un sélecteur redondant puisque tous les éléments sont des descendants de ce tag)</li>
<li style="text-align: justify">utiliser des sélecteurs de class plutot que des sélecteurs descendants</li>
<li style="text-align: justify">si vous devez utiliser un selecteur descendant, préférez un &laquo;&nbsp;child selector&nbsp;&raquo; qui nécessitera moins d&#8217;interprétation.</li>
<li style="text-align: justify">dans le cas d&#8217;IE, évitez les :hover pour les éléments qui ne sont pas des liens</li>
<li style="text-align: justify">si vous utilisez :hover sur des éléments qui ne sont pas des ancres, testez là sous IE 7 &amp; 8 pour être sur que ca fonctionne.</li>
</ul>
<p style="text-align: justify">Ok j&#8217;ai fais mon possible pour le traduire de l &#8216;anglais mais ce n&#8217;est pas mon domaine non plus alors si vous n&#8217;avez rien compris, <a href="http://gtmetrix.com/use-efficient-css-selectors.html">allez à la source, ici</a>. C&#8217;est un métier développeur Web, moi je vous le dis&#8230;</p>
<h2>Yslow : Avoid HTTP 404 (Not Found) error<br />
Yslow : Avoid URL redirects<br />
Pagespeed : Avoid bad requests<br />
Pagespeed : Minimize redirects</h2>
<p style="text-align: justify;">Ne riez pas et surtout vérifiez que vous n&#8217;en avez pas. Sur un site normal, en production normal, on ne doit pas tomber tous 3 objets sur un 404, ni même sur un 301 ou un 302. Qu&#8217;il y ait du rewriting temporairement pour maintenir une compatibilité, why not, que ce soit les 3/4 des URLs, encore plus vers un autre domaine, c&#8217;est  à proscrire.</p>
<p style="text-align: justify;">Les 404, on s&#8217;en doute, c&#8217;est mal, d&#8217;autant plus que c&#8217;est surtout votre SEO qui va prendre. Mais les redirections prennent du RTT (pas des vacances, du Round Trip Time, des voyages allers/retours), ce qui ralentit l&#8217;ensemble.</p>
<p style="text-align: justify;">Là aussi, c&#8217;est important, plus pour Pagespeed que pour Yslow qui tolère les 404 et dégrade moins la note.</p>
<p style="text-align: justify;">Pour trouver vos 404, les <a title="Google Webmaster tools" href="http://webmaster.google.com">google webmaster tools</a> peuvent vous aider, les plugins, dont Firebug vous les donnent, des sites sont aussi disponibles pour vous aider à les trouver. Personnellement, j&#8217;utilise Firebug, ca me suffit. (oui ok, je n&#8217;utilise pas que Opera, c&#8217;est vrai)</p>
<h2>Yslow : Do not scale images in HTML<br />
Pagespeed : Specify image dimensions<br />
Pagespeed : Optimize images<br />
Pagespeed : served scaled images</h2>
<p style="text-align: justify;">Alors, là on est sur de la logique pure et dure&#8230;</p>
<p style="text-align: justify">Si je prend une image en 800&#215;600, que je la pose sur le serveur et que je l&#8217;affice dans du 400&#215;300, j&#8217;ai transféré une image 2 fois trop grosse pour rien (en fait 4 fois trop grosse, faite la multiplication). Donc je dois servir des images de la taille de ce qui va être affiché.</p>
<p style="text-align: justify;">Je dois aussi spécifier les dimensions directement si possible (ca accélère le rendu des navigateurs) et bien sur, ne pas les redimensionner par du HTML, ce qui va à l&#8217;encontre de la précédente optimisation et aussi du fait qu&#8217;on a directement des images de la bonne taille.</p>
<p style="text-align: justify;">Pour ce qui est d&#8217;optimiser les images sans pertes de qualité, le plugin fournit tout seul les versions optimisées&#8230; C&#8217;est pas le bonheur ca ?</p>
<p style="text-align: justify;">Du bon sens on vous dit !</p>
<h2>Yslow : Put CSS at the top<br />
Pagespeed : Optimize the order of styles and scripts<br />
Pagespeed : Put CSS in the document head</h2>
<p style="text-align: justify">Le principe de fond c&#8217;est de charger les données dans l&#8217;ordre le plus efficient. Il faut que le début de la page puisse se charger le plus vite possible pour &laquo;&nbsp;visuellement occuper le terrain&nbsp;&raquo;. Si les images arrivent en dernier mais que tous les scripts sont chargés, le site est techniquement quasi fonctionnel mais inregardable.</p>
<p style="text-align: justify">Dans la première demi seconde, on doit donc passer les CSS pour &laquo;&nbsp;préparer le terrain&nbsp;&raquo;, formater la page et commencer à afficher du texte et des images puis faire passer les images nécessaires puis enfin le Javascript.</p>
<p>Une fois la page chargée, c&#8217;est rare qu&#8217;un utilisateur clic instantanément, il prend le temps de la lire un minimum avant de cliquer, le Javascript peut donc arriver un peu en retard, de même s&#8217;il se charge d&#8217;une animation, on peut patienter 1 seconde de plus, c&#8217;est moins génant qu&#8217;une page blanche.</p>
<p style="text-align: justify">Bon ca tient de la bonne parole inapplicable parfois. Par exemple WordPress continue de charger les JS en début de page en version avant 3.0 (je n&#8217;ai pas vérifié sur la 3.0). Sous Magento, selon votre site, vous aurez peut être besoin de certains JS rapidement. Bref, ca se fait bien en général mais le cas particulier est légion.</p>
<h2>Yslow : Reduce cookie size<br />
Pagespeed : Minimize request size</h2>
<p style="text-align: justify;">Là encore, on essaye de réduire la données &laquo;&nbsp;inutilement&nbsp;&raquo; transférée.<br />
L&#8217;idée c&#8217;est d&#8217;arrêter de transférer des cookies pour des ressources qui en ont aucun besoin, comme les images.</p>
<p style="text-align: justify;">Chaque cookie par le navigateur transféré va consommer un peu de bande passante et de temps, pour rien et des millions de fois sur un an. Je n&#8217;ai pas compté combien cela peut faire en arbre sur un an mais le bilan carbon des cookies inutiles est lamentable. D&#8217;une manière générale, réduire la taille des requêtes, des cookies et leur nombre au minimum.</p>
<p style="text-align: justify;">Alors Google et Yslow sont relativement d&#8217;accord, il faut servir les fichiers statiques depuis un domaines qui ne pose pas de cookies dans la transaction.</p>
<h2>Yslow : Make fewer HTTP requests</h2>
<p>Un croustillant celui-là. Ca à l&#8217;air anodin mais on pourrait faire un post rien que sur lui&#8230;</p>
<p style="text-align: justify;">J&#8217;aurais bien fait mon lache et laissé ca de coté si ce n&#8217;était pas justifié mais là&#8230; On va devoir le traiter, c&#8217;est pas un détail.</p>
<p style="text-align: justify;"><em>Welcome to the CSS Sprites world !</em></p>
<p style="text-align: justify;">Un sprite c&#8217;est quoi ? C&#8217;est globalement innofensif, c&#8217;est une image avec plein de morceau dans laquelle on découpe le bout dont on a besoin à un moment donné pour l&#8217;afficher. Oui, jusque là, ca à l&#8217;air innoffensif, attendez la suite.</p>
<p>Voici le CSS sprite du site NBS System, sur lequel Aymeric de l&#8217;agence Dnd (notre web agency) à sué sang et eau :</p>
<p style="text-align: center"><a rel="attachment wp-att-1553" href="http://www.wikigento.com/optimisation-systeme-reseau/optimisation-de-sites-magento/attachment/sprite1/"><img class="size-medium wp-image-1553 aligncenter" title="CSS sprite" src="http://www.wikigento.com/wp-content/uploads/2010/07/sprite1-500x340.png" alt="CSS sprite" width="500" height="340" /></a></p>
<p style="text-align: justify;">Si on résume la chose, c&#8217;est une image qui se comporte comme une carte. Quand on a besoin d&#8217;un bout de celle-ci, onva taper aux coordonnées X/Y qui vont bien et on on obtient ce que l&#8217;on a demandé. L&#8217;intérêt c&#8217;est qu&#8217;au lieu d&#8217;aller chercher 50 icones, on prend directement une grosse image, on fait donc 49 transferts http de moins avec toute l&#8217;économie d&#8217;overhead que ca représente.</p>
<p style="text-align: justify;"><span style="text-decoration: underline;">Du coup dans son CSS on change son image par : </span></p>
<p style="text-align: justify;">.blog .widget .header{height:42px;background:url(images/sprite.png) no-repeat 3px -258px;}</p>
<p style="text-align: justify;">Ca n&#8217;occupe aussi qu&#8217;une socket du navigateur au lieu de 50, ce qui part groupe de 10 impose 5 volées de récupération des données. (voir le paragraphe précédent et le leverage browser cache).</p>
<p style="text-align: justify;">Donc tout cela est merveilleux sauf que notre site, il vient rarement avec des sprites tout fait. Le graphiste lui, il fait des icones, il les fournit à l&#8217;intégration qui fait un CSS et du HTML et du coté sprites, il considère plus que c&#8217;est des boissons gazeuses.</p>
<p style="text-align: justify;">Alors comment on génère ses sprites ? Deux cas pour démarrer. Soit vous êtes fort chanceux et vous avez évitez la problématique des dégradés et des ombres et ca va considérablement faciliter votre travail. Soit vous avez un beau site mais vous allez y passer du temps à vos sprites&#8230;</p>
<p style="text-align: justify;">On peut le faire à la main, avec amour, mais ca prend un peu de temps&#8230; Quoiqu&#8217;il arrive, il faut passer par le stade préprod / prod, comme pour les compilations de JS /CSS sinon c&#8217;est pas facile à maintenir.</p>
<p style="text-align: justify;">Bonne nouvelles : Il existe des générateurs.<br />
Mauvaise nouvelle : Ca marche pas toujours et pas dans tous les cas.</p>
<p><span style="text-decoration: underline;">Trois bonnes pistes sérieuses :</span></p>
<ul>
<li style="text-align: justify;"><a title="Sprite me" href="http://spriteme.org/">Sprite me : Le plus atypique et très bien pensé.</a> Il marche en bookmarklet, l&#8217;avantage c&#8217;est qu&#8217;il génère les différences à faire dans son CSS en live, c&#8217;est bien fait, assez efficace.</li>
<li style="text-align: justify;"><a href="http://csssprites.com/">un autre générateur en ligne</a>, très simple mais moins complet aussi je trouve</li>
<li style="text-align: justify;"><a title="Spritegen" href="http://spritegen.website-performance.org/">un des plus complets</a> : spritegen</li>
</ul>
<p style="text-align: justify;">Il existe aussi un truc super bien je pense qu&#8217;à utilisé Aymeric pour mon site mais ce petit cachotier n&#8217;a pas voulu me dire son nom&#8230; Peut être une trouvaille ou un développement maison, je vais le cuisiner, n&#8217;hésitez pas à envoyer pleinnnnnnn de mails à l&#8217;agence DnD jusqu&#8217;à ce qu&#8217;ils lachent l&#8217;info !</p>
<p style="text-align: justify;">En complément : <a title="CSS Sprites" href="http://www.alistapart.com/articles/sprites">un article assez complet</a> traduit en Français <a href="http://www.pompage.net/pompe/sprites/">ici</a>. Sous WordPress il y avait Csprite qui était pas mal mais qui n&#8217;est plus maintenu&#8230; <a href="http://css-tricks.com/css-sprites/">Un autre article pas mal du tout ici</a>.</p>
<p style="text-align: justify;"><a href="http://www.interactivellama.com/blog/archives/photoshop-script-combine-two-images-css-hover-css-sprite/">Un moyen de générer vos CSS sprites avec Photoshop aussi ici.</a></p>
<p style="text-align: justify;">A l&#8217;époque où je faisais une fixation sur les CSS sprites, j&#8217;avais trouvé un binaire opensource assez formidable qui permettait de commenter un CSS normal et de le compiler après coup en un CSS utilisant un Sprite, tout en générant le sprite au passage. Top. Mais j&#8217;ai perdu la bookmark pour le moment alors dès que je l&#8217;ai retrouvé, je corrige ce post, si vous voyez de quoi je parles, postez moi un petit commentaire.</p>
<h1>Les derniers points</h1>
<h2>Yslow : Reduce the number of DOM elements</h2>
<p>Les objets DOM (Document Object Model) nécessitent d&#8217;être tous chargés et parsés avant que les interprêtations Javascript (notamment) ne démarrent. Donc plus d&#8217;objets, plus de taille et donc de transfert, plus de mémoire utilisée, plus de temps de traitement, plus de délai avant que toute la page ne soit prête.</p>
<p>Réduite la taille du DOM est donc important dans une certaine mesure.</p>
<p>C&#8217;est d&#8217;autant plus vrai que les surfers ont de plus en plus de pages ouvertes en tabs, si tout le monde force en Javascript et pose des DOM énorment, les browsers se tapent des indigestions et &#8230; ca rame. C&#8217;est une question d&#8217;hygiène globale du browser quelque part <img src='http://www.wikigento.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Yslow : Make favicon small &amp; cacheable</h2>
<p style="text-align: justify">Parfois, je n&#8217;aimerai pas être une mouche chez Yahoo. Celui qui a sortie celle-ci est légèrement <em>&laquo;&nbsp;tatillon&nbsp;&raquo;</em> quand même, voir dypterophile sodomite à tendance compulsive.</p>
<p>Bon la Favicon, en faire une petite, c&#8217;est pas trop dur. Optimisée non plus. Par contre, la rendre cachable, ca a été un poil énervant car Apache n&#8217;aimait pas le mime/type ico ou gif/jpg donc ca ne parait jamais dans le module mod_expire&#8230;</p>
<p>Très pénible jusqu&#8217;à ce que je trouve le type mime des favicons :</p>
<pre>ExpiresByType <strong>image/vnd.microsoft.icon</strong> "access plus 6 months"</pre>
<p>Et voila, c&#8217;est caché, d&#8217;un coup l&#8217;Internet va plus vite&#8230; ou pas.</p>
<h2>Yslow :  Avoid AlphaImageLoader filter</h2>
<p style="text-align: justify">Oui alors si certains sont encore assez téméraires pour tenter d&#8217;afficher des images transparentes, style png, dans un IE datant d&#8217;avant la version 7, je penses qu&#8217;il a d&#8217;autres priorité en terme d&#8217;optimisation que ce que je racontes là.  Les soins psychiatriques et une URL de download d&#8217;Opera, Firefox ou Chrome.</p>
<p>En gros si vous jouer avec de la gif / png transparente, IE ne gère pas ca très bien, au mieux ca le ralentit, parfois ca le fait planter, on a même vu des failles de sécurité grave sur ce sujet&#8230;</p>
<p>Donc forcément, il faut éviter de proposer une bouteille de vodka à un alchoolique, là c&#8217;est pareil, pas de png transparente pour IE.</p>
<h2>Pagespeed : Minify HTML</h2>
<p style="text-align: justify">Alors là, forcément, on s&#8217;affronte à un problème. Soit on a un framework (magento, drupal, wordpress etc&#8230;) qui fait ca tout seul, bref du php qui génère du HTML, soit on a fait le sien. La deuxième catégorie devient rare et dans la première, sans toucher au core, on a peut de moyen d&#8217;action en général.</p>
<p style="text-align: justify">La plupart des outils proposent un système de templates qu&#8217;on peut optimiser mais c&#8217;est parfois coton. A voir mais sur le site de NBS par exemple, pour 7,9 Ko à réduire, il me met un malus de 27% sur ce point et me dégrade la note à C&#8230; Abusif je trouve mais bon, soit.</p>
<h2>Pagespeed : Specify a cache validator</h2>
<p>L&#8217;idée c&#8217;est de donnée la méthode par laquelle on vérifie que la ressource est fraiche ou non. Sous Apache, ca se fait par l&#8217;intermédiaire du paramètre :</p>
<pre>FileETag MTime Size</pre>
<p>Là on précise à Apache qu&#8217;on décide que la ressource à changé si soit la date de modification à changée, soit la taille.</p>
<h2>Pagespeed : Specify a Vary:Accept-Encoding header</h2>
<p>Allez, devinez, c&#8217;est encore pour IE&#8230; Comme quoi on peut faire un produit ultra pourrit et l&#8217;imposer sur le marché. Ca on peut pas enlever ca à Microsoft. Je n&#8217;ai rien contre eux sur le fond mais sur le navigateur, ils ont vraiment pourrit le web.</p>
<p>Notre ami IE donc, ne support pas les Vary headers. Du coup, si il trouve dans le header d&#8217;une ressource autre chose que User-agent et Accept-encoding, il ne la cache pas&#8230; Dans le principe, totalement se passer du Vary header est le mieux.</p>
<h2>Pagespeed : Specify a character set early</h2>
<p style="text-align: justify">Dès qu&#8217;on précise le character set, le navigateur peut démarrer certaines interprêtation, dont Javascript. Avant il ne sait pas comment interpréter les données, il est donc conseillé de le faire vite. En fait rien ne s&#8217;oppose à le faire le plus tôt possible et tous les framework standard le font en général.</p>
<h2>Yslow : Make JavaScript and CSS external</h2>
<p style="text-align: justify;">Avoir des fichiers séparés pour les CSS et les JS permet de les stocker en cache et de ne pas les transférer dans le HTML à chaque échange ou chaque page. Donc il vaut mieux ne pas mettre son JS et son CSS directement dans le code HTML et faire un include de fichiers externes, c&#8217;est beaucoup plus propre et simple.</p>
<h2>Yslow : Make AJAX cacheable</h2>
<p>En fait sur ce point, ce qu&#8217;il faut comprendre derrière le laconique &laquo;&nbsp;Make Ajax Cacheable&nbsp;&raquo; c&#8217;est &laquo;&nbsp;Make Ajax requests results cacheable&nbsp;&raquo;.</p>
<p style="text-align: justify;">Faire un requête ajax en background pour fluidifier le trafic c&#8217;est top mais ne pas stocker la ressource récupérer en cache c&#8217;est gacher ce premier transfert, reconsommer de la bande passante, participer activement à la déforestation des ours en pologne, bref, c&#8217;est le mal.</p>
<h2>Yslow : Use GET for AJAX requests</h2>
<p style="text-align: justify;">oUn Get est plus valable qu&#8217;un POST car avec un GET on transfert le headers et les données en même temps, ca évite un transfert inutile. Cependant, si vous avez des requêtes un peu longues, IE n&#8217;accepte pas les requêtes de plus de 2Ko. Qui a dit &laquo;&nbsp;encore IE&nbsp;&raquo; ? Pas de dénigrement, on est là pour progresser, tous ensemble, même les browsers qui partent avec de sérieux handicapes de conception.</p>
<p style="text-align: justify;">Les vrais pervers tenteront donc de transférer en GET, des images PNG transparentes de plus de 2 Ko, en laissant le vary-header avec un IE. Là normalement, on a tout bon pour avoir un beau blue screen <img src='http://www.wikigento.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Yslow : Reduce DNS lookups<br />
Pagespeed : Minimize DNS lookups</h2>
<p style="text-align: justify">Une résolution DNS prends entre 10 et 100 ms en gros. Pendant ce temps, le browser doit attendre que la résolution se fasse. Si on peut lui éviter d&#8217;avoir à résoudre beaucoup de noms et/ou hostnames différents, c&#8217;est plutot positif. Cela va aussi à l&#8217;encontre des multiplication hostname sur un domaine différents pour paralléliser les download quelque part.</p>
<p>Une fois résolu, la réponse reste en général dans un cache local, on peut donc décemment imaginer que multiplier les hostnames (par exemple 4 statics) est correctement rentable et n&#8217;impose pas trop de lookups.</p>
<h2>Pagespeed : Remove query strings from static   resources</h2>
<p>Typiquement ca :</p>
<p>http://www.nbs-system.com/wp-includes/js/jquery/jquery.js?ver=1.3.2</p>
<p>La paramètre <strong>&laquo;&nbsp;?ver=1.3.2&#8243;</strong> empèche certains proxys (dont Squid notamment) de cacher la ressource.</p>
<h2>Pagespeed : Serve resources from a consistent URL</h2>
<p style="text-align: justify">Pour les ressources partagées sur de multiples pages ou sites, il vaut mieux que la référence se fasse par rapport à une unique URL.<br />
Cela permet notamment de ne pas renvoyer de fichier depuis plusieurs endroits différents, provocant des ns lookups d&#8217;ailleurs. L&#8217;exemple donné par Google c&#8217;est que si monsite.exemple.com et tonsite.exemple.com utilise le même JS, autant qu&#8217;il soit servit directement depuis un seul des deux sites, comme ca il sera déjà en cache dans le browser quand on ira de l&#8217;un à l&#8217;autre.</p>
<h1>Autres optimisations</h1>
<p style="text-align: justify;">D&#8217;une manière général, il y a beaucoup d&#8217;autres optimisations, plus systèmes celles-ci, j&#8217;en parlerai prochainement, peut être directement sur <a title="Blog NBS System" href="http://www.nbs-system.com/blog">le blog de NBS System</a>. Les reverses proxy, les compilations de noyaux, les optimisations de .htaccess etc&#8230;</p>
<p style="text-align: justify;">Mais bon, on a déjà de quoi s&#8217;amuser un peu là non ? <img src='http://www.wikigento.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: justify;">Je paye ma tournée au premier qui nous sort son site en A/A, ensuite celui qui nous passe un site Magento en A/A et pareil pour celui qui fait 100%/100% (sans tricher). Ca fera trois tournées mais elles seront largement méritées, chacunes d&#8217;elles !</p>
<p style="text-align: justify;">
<p style="text-align: justify;">PS : La <a href="http://code.google.com/speed/page-speed/docs/rules_intro.html">doc de Google</a> sur ces sujets est excellente, n&#8217;hésitez pas à la consulter.</p>
<p style="text-align: justify;">
Vous pouvez également lire l&#8217;article d&#8217;Arnaud ici : <span style="font-size:11.0pt;font-family:"><a href="http://bit.ly/ban1Pm">http://bit.ly/ban1Pm</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wikigento.com/optimisation-systeme-reseau/optimisation-de-sites-magento/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Quelques nouvelles de la planète Magento</title>
		<link>http://www.wikigento.com/optimisation-lampzendmagento/quelques-nouvelles-de-la-planete-magento/</link>
		<comments>http://www.wikigento.com/optimisation-lampzendmagento/quelques-nouvelles-de-la-planete-magento/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 15:28:40 +0000</pubDate>
		<dc:creator>Philippe Humeau</dc:creator>
				<category><![CDATA[Actualités]]></category>
		<category><![CDATA[Optimisation LAMP/Zend/Magento]]></category>
		<category><![CDATA[général]]></category>

		<guid isPermaLink="false">http://www.wikigento.com/?p=1420</guid>
		<description><![CDATA[Alors me voila de retour sur Paris, après une semaine de mauvais temps dans un pays où la dernière fois où il a plu devait être en 1912&#8230; Du coup, je me remet en jambes avec quelques news du milieu Magento : Sortie de la 1.4 CE Bon, finalement c&#8217;est fait, la 1.4 de Magento [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify">Alors me voila de retour sur Paris, après une semaine de mauvais temps dans un pays où la dernière fois où il a plu devait être en 1912&#8230; Du coup, je me remet en jambes avec quelques news du milieu Magento :</p>
<p style="text-align: justify">
<h2>Sortie de la 1.4 CE</h2>
<p style="text-align: justify">Bon, finalement c&#8217;est fait, la 1.4 de Magento est sortie. Vous pouvez <a title="Magento 1.4" href="http://www.magentocommerce.com/download/get-started">la trouver ici</a> et un compte rendu complet des nouveautés <a href="http://fragento.org/Actualite/Magento/magento-ce-140-stable-est-sortie.html">ici sur Fragento</a>.</p>
<p style="text-align: justify">Donc après plusieurs mois d&#8217;absence, on va enfin pouvoir tester la bête en terme de performances et de sécurité. Je suis en tout cas rassuré que Varien n&#8217;ait pas mis de coté la CE plus longtemps car cela devenait politiquement problématique.</p>
<p style="text-align: justify">
<h2>Bargento en régions = Apérogento ?</h2>
<p style="text-align: justify">Gabriel et moi travaillons étroitement avec SeL et Varien à l&#8217;animation de la communauté Magento en France mais nous n&#8217;avons pas le temps de tout suivre ou de tout faire. J&#8217;ai appris avec surprise et joie que de nombreux évènements s&#8217;organisaient en région, des apérogentos notamment et je trouve cela super.</p>
<p style="text-align: justify">Vu de Paris, on ne peut pas beaucoup aider à cela me disais-je mais finalement j&#8217;ai revu mon jugement. Déjà, apéro ou autres horaires, on peut éventuellement passer faire un bonjour, ca nous fera plaisir, même si ca n&#8217;aide en rien les organisateurs <img src='http://www.wikigento.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: justify">Par contre, on peut fournir un peu de logistique aux organisateurs ! De la visibilité en annonçant ca sur Wikigento, Bargento (et probablement Fragento même si je n&#8217;en ai pas encore parlé à Gabriel) voir même en faisant poster par Varien un billet avec un espèce d&#8217;agenda sur le blog FR.</p>
<p style="text-align: justify">Ensuite, j&#8217;ai des bases de données  assez complète de la sphère Magento en France, ca pourrait permettre de faire un petit mailing pour les organisateurs pour pousser la chose.</p>
<p style="text-align: justify">Bref, si vous voulez faire un Apérogento en région, comme à Lille, Toulouse et Lyon où on m&#8217;en a déjà parlé, je suis tout à fait prêt à donner un coup de main mailing et de la visibilité pour les organisateurs ! Il suffit de me contacter : philippe[at]wikigento.com</p>
<p style="text-align: justify">
<h2>Des plugins sympas pour Magento</h2>
<p style="text-align: justify">Déjà Cocorico, un plugin Français pour commencer. La communauté est active, les idées fusent et les modules émergent. La société Xhéos m&#8217;informe, par l&#8217;entremise de Michaël Thieulin, que l&#8217;extension AMF service permet une intégration complète de modules Air/Flex dans le core de Magento.</p>
<p style="text-align: justify">Le protocole AMF s&#8217;invite donc dans le core de Magento et permet également des traitements de plus grands volumes de manière plus efficace. Faire communiquer du Flash sur le front office avec votre Backoffice, c&#8217;est partit avec <a href="http://www.magentocommerce.com/extension/2930/xheos-amf-webservice">AMF Webservice</a>.</p>
<p style="text-align: justify"><span style="text-decoration: underline;">Dans la série on s&#8217;y intéresse :</span> les plugins de performances.</p>
<p style="text-align: justify">L&#8217;incontournable <a href="http://www.magentocommerce.com/extension/457/fooman-speedster">Fooman Speedster</a> qui concatènent les JS et les CSS pour réduire leur taille et optimiser le transfert n&#8217;est plus seul en piste puisqu&#8217;en ce moment plusieurs initiatives visent à optimiser les transferts, les requêtes, les compilations. Où se situe l&#8217;avenir ?</p>
<p style="text-align: justify">Dans mon idée, vous le savez, sur la compilation du PHP.</p>
<p style="text-align: justify">Un langage interprété ne sera jamais aussi rapide qu&#8217;un compilé. En attendant que les initiatives en ce sens (dont une très prometteuse dont je vous reparlerai) voient le jour, des plugins visent à améliorer les temps de chargement.</p>
<p style="text-align: justify">Bien que je n&#8217;ai pas eu encore l&#8217;occasion de les essayer, Delorum propose des <a href="http://store.delorumcommerce.com/">Magento lignthing hyper megaspeed </a>modules (je vais essayer de benchmarker cela). J&#8217;ai vu une autre société proposant des modules similaires à la vente mais l&#8217;URL ne me revient pas (EDIT : ah si en fait <a href="http://www.aitoc.com/en/magento_booster.html">c&#8217;est ici, magento Booster</a>). Si  vous en avez, postez en commentaire, on fera un petit benchmark pour voir qui donne quoi !</p>
<p style="text-align: justify">Dans les facteurs externes pouvant améliorer les performances de la bête (qui ne cesse de progresser dans son core, reconnaissons le) le moteur de recherche SolR de l&#8217;apache consortium vous donnera des recherches de la plus grande rapidité, même dans des catalogues énormes comme dans le c as du Furet du Nord (réalisé par Smile, hébergé et optimisé par NBS System). Toujours dans les &laquo;&nbsp;externes&nbsp;&raquo; (même si Zend a un unified installer avec Magento), Zend Server améliore les performances avec son Full Page Cache et ses différents mécanismes.</p>
<p style="text-align: justify">
<h2>La vitesse comme facteur de ranking Google</h2>
<p style="text-align: justify;"><a href="http://searchengineland.com/site-speed-googles-next-ranking-factor-29793">Matt Cutts de Google a expliqué en novembre dernier</a> que Google avait une forte pression interne en ce moment, notamment de l&#8217;un de ses fondateurs, pour intégrer la vitesse de chargement d&#8217;une page comme facteur de ranking.</p>
<p style="text-align: justify;">C&#8217;est l&#8217;avènement d&#8217;une chose que l&#8217;on suspectait tous et Google l&#8217;officialise quelque part en laissant l&#8217;info filtrer publiquement. Le plus étonnant en fait c&#8217;est que ce facteur était déjà probablement pris en compte depuis des mois d&#8217;après nos tests, sans que Google ne le dise.</p>
<p style="text-align: justify;">La question qui subiste est donc de savoir si pour posséder un bon référencement naturel il faut avoir une page qui se charge vite ou une page qui se charge plus vite que les autres. La deuxième option me parait un peu radicale par contre il y a fort à parier que les sites lents à charger se verront sanctionner dans le référencement naturel puisque, dixit un fondateur du géant, &laquo;&nbsp;passer de la recherche au site doit se faire aussi naturellement que tourner une page d&#8217;un livre&nbsp;&raquo;.</p>
<p style="text-align: justify;">
<p style="text-align: justify">
<h2>Un Bargento International</h2>
<p style="text-align: justify">Ok on y est, on passe au dessus du gouffre et on verra bien comment ca va se passer&#8230; Bargento devient international. En gros, on invite nos copains européens qui n&#8217;ont pas la chance d&#8217;avoir un évènement local à Paris pour venir échanger avec nous tous.</p>
<p style="text-align: justify">La décision a été complexe à prendre, le cafouillage de dates vient en partie de là mais Bargento va en ressortir plus grand, plus fort et plus beau. Avec des fournisseurs de solutions et de compétences de tous horizons, des plugins que vous ne soupçonniez même pas, des clients des quatre coins de l&#8217;Europe !</p>
<p style="text-align: justify">Venez donc faire la fête internationale avec nous le 28 mai 2010, plus d&#8217;info prochainement sur Bargento.fr</p>
<p style="text-align: justify">
<p style="text-align: justify">
<p style="text-align: justify">
]]></content:encoded>
			<wfw:commentRss>http://www.wikigento.com/optimisation-lampzendmagento/quelques-nouvelles-de-la-planete-magento/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Javascript &amp; PHP, deux goulots d&#8217;étranglement du Web ?</title>
		<link>http://www.wikigento.com/optimisation-lampzendmagento/javascript-php-performances/</link>
		<comments>http://www.wikigento.com/optimisation-lampzendmagento/javascript-php-performances/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 12:52:45 +0000</pubDate>
		<dc:creator>Philippe Humeau</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Optimisation LAMP/Zend/Magento]]></category>
		<category><![CDATA[Php/Zend/Magento]]></category>
		<category><![CDATA[compilation php]]></category>
		<category><![CDATA[interprétation php]]></category>
		<category><![CDATA[langage interprété]]></category>
		<category><![CDATA[performance Javascript]]></category>
		<category><![CDATA[performance magento]]></category>
		<category><![CDATA[performance php]]></category>
		<category><![CDATA[performance zend]]></category>

		<guid isPermaLink="false">http://www.wikigento.com/?p=1372</guid>
		<description><![CDATA[Cet article parle des performances de Javacsript et de celles de PHP, qui sont au coeur du Web moderne mais en fait pas forcément optimisés.]]></description>
			<content:encoded><![CDATA[<h1 style="text-align: justify;"><strong>Javascript et PHP sont-ils des sources de ralentissements ?</strong></h1>
<p><BR></p>
<p style="text-align: justify;">Je vais me faire des amis avec un titre comme celui-là <img src='http://www.wikigento.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: justify;">Maintenant, au-delà de la provoque, menons une analyse objective.</p>
<p style="text-align: justify;">Nous avons, de nos jours, (au moins) deux gros goulots d’étranglement lorsque nous nous adressons à un site Web :</p>
<ul style="text-align: justify;">
<li>Javascript du coté du client</li>
<li>PHP du coté du serveur.</li>
</ul>
<p style="text-align: justify;">Analyse…</p>
<h2 style="text-align: justify;"><strong>Parlons de Javascript&#8230;</strong></h2>
<p style="text-align: justify;">En général, je m&#8217;intéresse plus aux performances des serveurs que des clients au sens &laquo;&nbsp;navigateurs&nbsp;&raquo;. En réalité, la performance des clients est en générale très liée à celle des serveurs pour être plus précis. Mais le serveur ne peux pas toujours tout.</p>
<p style="text-align: justify;">Notamment les browsers encaissent plus ou moins bien le Javascript et surtout beaucoup de Javascript.</p>
<p style="text-align: justify;">Opera, Chrome, Firefox, Internet Explorer et leurs copains ont une tendance très nette à réagir différemment (je n&#8217;apprends rien aux développeurs Web) et surtout à réagir plus ou moins bien et plus ou moins vite en interprétation de Javascript. De plus, ces différences se cumulent avec des comportements très différents d&#8217;un browser à l&#8217;autre, notamment le nombre de requêtes concurrentes (nombres d&#8217;éléments de la page chargé en parallèle).</p>
<p style="text-align: justify;">Tous les sites récents utilisent énormément de Javascript et ont donc une belle tendance à charger la mule, surtout quand on a plusieurs onglets d&#8217;ouverts sur plusieurs sites, on a tout de suite des machine virtuelle javascript au sein des navigateurs qui se mettent à grossir.</p>
<p style="text-align: justify;">Ok, so what ? Qu&#8217;est ce que j&#8217;y peux me réponde les développeurs&#8230;</p>
<p style="text-align: justify;">Eh bien beaucoup de choses en fait. Déjà, un framework c&#8217;est bien mais ca n&#8217;empêche pas de réfléchir. Faire confiance aveuglément sans regarder le dessous des cartes, c&#8217;est ce qui mène au gâchis de ressources.</p>
<p style="text-align: justify;">Optimiser ces points (comme d&#8217;autres), c&#8217;est ce que j&#8217;appelle la &laquo;&nbsp;culture atari / amiga&nbsp;&raquo;.  En gros, à l&#8217;époque, les développeurs avaient des machines identiques, des machines avec des limites et on pensait à tirer le meilleur partie du Hardware, on optimisait son programme à la goutte prêt, on passait au plus proche du matériel pour faire des choses que les concepteurs de ces machines n&#8217;avaient même pas imaginé.</p>
<p style="text-align: justify;">De nos jours, on prend un framework, on instancie un objet et hop, derrière ca pédale mais c&#8217;est plus mon problème&#8230; Revenons à Javascript.</p>
<h2 style="text-align: justify;"><strong>Des soucis de tableaux !</strong></h2>
<p style="text-align: justify;">Il y a de nombreuses sources de maux dans Javascript, langage qui devient incontournable sur le Web depuis 5 ans. Mais lorsque les sites traitent de sujets plus complexes ou offres de nouveaux raffinement, ce qui était &laquo;&nbsp;une brique parmi d&#8217;autres&nbsp;&raquo; devient plus sensible.</p>
<p style="text-align: justify;">Commençons par un soucis simple de Javascript : les tableaux.</p>
<p style="text-align: justify;">Allouer un tableau en JS déclenche des mécanismes très différents d’un malloc en C. Allons y ! Sous IE, la logique de traitement est la suivante :</p>
<p style="text-align: justify;">var my_array = new Array();</p>
<p style="text-align: justify;">for (i = 0; i &lt; 100000; i ++)</p>
<p style="text-align: justify;">my_array[i] = i;</p>
<p style="text-align: justify;">1°) Je crée un objet array qui est une table de hashage.</p>
<p style="text-align: justify;">2°) Comme une table de hashage est un objet générique, je lui crée un attribue length (taille) et on le met à 0</p>
<p style="text-align: justify;">3°) La boucle fait, pour chaque valeur de i</p>
<ul style="text-align: justify;">
<li>Une conversion de i en string (chaine de caractère, en gros i= « i »)</li>
<li>Ajoute un clef de hash pour chaque couple « chaine i », i</li>
<li>Réajuste la valeur de length</li>
</ul>
<p style="text-align: justify;">OMG. Donc, rien que pour assigner une valeur au tableau, on a fait 3 opérations (dont deux totalement inutile si on a codé un jour en C).</p>
<p style="text-align: justify;">Pour compléter le tableau, les allocations réelles de mémoire ne sont pas continues car les tableaux sont gérés sous la forme de « sparse » array.</p>
<p style="text-align: justify;">C’est avantageux en terme d’usage réel de la RAM car les blocks vides ne sont pas alloués, par contre les allocations ne sont pas contigüe. Du coup, les accès à ces blocks de données ne se font pas à la suite et n’utilise pas certains mécanismes de prédiction des processeurs ou certains caches des OS. De plus les entrées du tableau ne sont pas indexées.</p>
<p style="text-align: justify;">Bon, maintenant, on a tout pour faire une usine à gaz de compétition !</p>
<p style="text-align: justify;">Pour résoudre ce premier point, sous IE 8, le « sparse array » est détecté comme étant dense ou non. En gros il est très peuplé ou non. Pour que l’heuristique de IE8 comprenne que c’est un « dense sparse array », il faut que ce tableau soit d’une taille explicite (en théorie mais un autre blog ne dénote pas de différence de perfs sur ce point) par contre, il faut en initialiser tous les éléments. Le défaut c’est que toute la RAM est allouée et le coté « sparse » disparait.</p>
<p style="text-align: justify;">Sur un gros PC ce n’est pas si dramatique mais sur un téléphone portable, ouch… Du coup, initialiser l’ensemble du tableau n’est pas toujours la bonne option. Un comportement optimal serait de détecter le navigateur et de lui proposer un Javascript optimisé pour le ratio Rapidité, consommation de CPU &amp; RAM, logique de traitement. Une sorte de librairie optimisée de gestion des tableaux, dépendante de la plateforme qui l’exécute.</p>
<p style="text-align: justify;">En termes d’impacts c’est non négligeable !</p>
<p style="text-align: justify;">Quelques très bon liens pour ceux que ca intéresse. Le premier blog a d’ailleurs de très bons papiers d’une manière générale !</p>
<p style="text-align: justify;"><a href="http://www.outofwhatbox.com/blog/2009/11/javascript-array-performance-initialize-to-optimize/">http://www.outofwhatbox.com/blog/2009/11/javascript-array-performance-initialize-to-optimize/</a></p>
<p style="text-align: justify;"><a href="http://www.outofwhatbox.com/blog/2009/12/javascript-array-performance-and-why-it-matters/">http://www.outofwhatbox.com/blog/2009/12/javascript-array-performance-and-why-it-matters/</a></p>
<p style="text-align: justify;"><a href="http://blogs.msdn.com/jscript/archive/2008/03/25/performance-optimization-of-arrays-part-i.aspx">http://blogs.msdn.com/jscript/archive/2008/03/25/performance-optimization-of-arrays-part-i.aspx</a></p>
<p style="text-align: justify;">
<h1 style="text-align: justify;"><strong>PHP et les performances : plantons le décor</strong></h1>
<p><BR></p>
<p style="text-align: justify;">Revenons à nos serveurs ! Dans une infrastructure Magento, ce qui pompe dur au niveau des performances, c’est PHP et de très loin.</p>
<p style="text-align: justify;">Il faut évidemment de la RAM pour accélérer les accès et traiter les données mais les appels PHP coutent très chers. Et c’est bien logique car le Web est coincé dans un incroyable paradoxe.</p>
<p style="text-align: justify;">Les langages interprétés (comme PHP) sont très adaptés à certains traitements mais d’une manière générale, pour tous les traitements répétitifs ou massifs, on les évite.</p>
<p style="text-align: justify;">L’idée c’est que dans la rapidité des langages, l’échelle est très claire :</p>
<h3 style="text-align: justify;"><span style="text-decoration: underline;">Les compilés :</span></h3>
<p style="text-align: justify;">Les langages ASM/C et C++ sont compilés et (donc) très rapides. On décrit le code et cela se transforme en Opcode directement interprétables et optimisables par le processeur. Tous les caches deviennent super efficaces (L1/L2/L3 du processeur notamment) et le programme traite les données au fil de l’eau et au fil du temps. Le programme se charge en mémoire, il ne s’arrête que quand on lui demande et peut sommeiller le temps d’attendre son prochain traitement.</p>
<p style="text-align: justify;">Assembleur : niveau processeur directement, très peu voir pas d’interprétation, vitesse maximale.</p>
<p style="text-align: justify;">C : Le code produit par un compilateur C est très proche de l’assembleur et donc extrêmement rapide. Pour autant cela reste un langage relativement évolué, contrairement à l’assembleur on a pas à tout écrire de zéro, des librairies existent, des includes, du code un peu évolué d’une manière générale.</p>
<p style="text-align: justify;">C++ : Un langage C évolué et Objet. On monte encore un peu dans les couches, on fait de l’objet et du fonctionnel, on en est plus à la douce barbarie redoutablement efficace de l’assembleur mais ca reste un code qui, une fois compilé, est redoutablement efficace.</p>
<p style="text-align: justify;">Très peu souples en typage ou en gestion de la mémoire, ces trois langages compilés, pour ne citer qu’eux, sont extrêmement rapides !</p>
<h3 style="text-align: justify;"><span style="text-decoration: underline;">La machines virtuelles :</span></h3>
<p style="text-align: justify;">Ce sont des programmes qui crée un environnement permettant d’exécuter d’autres programmes en leur sein. L’intérêt essentiel est de s’affranchir de la couche en dessous, en gros le programme devient portable partout. Si la VM existe pour l’environnement matériel cible, le programme tournera (presque) à l’identique sans rien redévelopper. L’inconvénient, comme toute forme de virtualisation, c’est que la VM consomme de la ressource pour créer cette couche d’abstraction, bilan ces langages ne sont pas toujours des foudres de guerre.</p>
<p style="text-align: justify;">Java et autres JVM</p>
<p style="text-align: justify;">Java est le plus connu des langages tournant dans une machine virtuelle, la JVM. C’est un bon langage, objet, évolué et indépendant du matériel mais il souffre de devoir être compilé tout en étant pas aussi rapide qu’un autre langage compilé.</p>
<p style="text-align: justify;">Les « interprétés » :</p>
<p style="text-align: justify;">Aïe. Perl, PHP et de nombreux copains à eux sont des langages dits « interprétés ». A chaque fois qu’il est lancé, le programme (test.php par exemple) est lu par un interpréteur externe (php par exemple), le fichier est parcouru, compilé à la volée quelque part, mais une fois finit, on repart de zéro. Le fichier programme à interpréter est donc lu à chaque fois et le programme qui le lit, l’interpréteur, est un programme qui est lui chargé à chaque exécution aussi.</p>
<p style="text-align: justify;">PHP :</p>
<p style="text-align: justify;">Un des plus célèbres. Zend au dessus est en fait composé de PHP objet évolué au sein d’un Framework, encore une couche d’abstraction. Donc si l’on compare avec nos précédents amis, Zend c’est le C++, Php le C sauf que tout cela est lu/chargé/parsé/interprété puis exécuté en continu. C’est un peu comme si on avait à se taper la compilation a chaque fois qu’on lance le programme… En fait l’image est très exacte puisque c’est quasiment exactement ce qui se passe. Bilan, les langages interprété c’est pratique, facile à maintenir et programmer, on s’affranchit de tous les aspects un peu rigoureux d’allocation mémoire ou de gestion des taches de bases mais le coût en terme de performances est énorme.</p>
<p style="text-align: justify;">PS : Javascript est un langage de scripting interprété tournant dans une machine virtuelle (navigateur)… Tout pour gagner J</p>
<h1 style="text-align: justify;"><strong>Vers un PHP compilé ?</strong></h1>
<p><BR></p>
<p style="text-align: justify;">Comme signalé plus haut, l’interprété c’est consommateur et pas adapté aux traitements récurrents. Maintenant si l’on considère une architecture d’hébergement Web, que se passe-t-il.</p>
<p style="text-align: justify;">Admettons que le site soit en Magento, on a un framework de deuxième niveau, qui repose sur un framework de premier niveau (Zend) qui repose sur un langage interprété objet (PHP5) qui repose sur un interpréteur (Php) qui lui-même est compilé et s’adresse en assembleur au processeur.</p>
<p style="text-align: justify;">Ajoutez un peu de virtualisation là-dessus et avant qu’une requête ne passe à travers tout ce maillage, vous avez perdu une quantité de puissance tout proprement hallucinante !</p>
<p style="text-align: justify;">En soit, aucun reproche au fait d’utiliser PHP ou sa syntaxe, par contre, soyons clairs l’approche est juste complètement aberrante. En fait si on essayait de faire pire, le seul moyen, ca serait de faire tourner l’interpréteur php dans une JVM…</p>
<p style="text-align: justify;">Et oui, ce n’est pas anodin mais bien dramatique. A chaque fichier PHP que vous chargez, l’interpréteur est lancé. A chaque fichier php de chargez, vous provoquez toute la cascade de compilation, d’accès disque, d’exécution. Quand un visiteur passe, il provoque donc des centaines de lancement du programme PHP qui va interpréter autant de fichiers… C’est une boucherie, une hémorragie de puissance pour finalement un problème très bête.</p>
<p style="text-align: justify;">Le problème ce n’est pas Magento, Zend ou les fichiers PHP en soit. Sortons de la barbarie de l’assembleur, vive l’objet et tout et tout, on développe plus vite, on réutilise du code, on capitalise des librairies ! C’est l’avancement logique, l’avenir, donc ca va continuer à se développer. Par contre, pourquoi on ne compile pas tout cela ?</p>
<p style="text-align: justify;">La charge CPU des serveurs serait juste divisée par un facteur 10 à vue de nez… C’est à ce point négligeable ? Plus clairement, sur un serveur, au lieu d’accueillir 20 000 personnes par jours par exemple, on en accueillerait 200 000. Avec le même serveur. L’approximation est un peu grossière mais pas outrancière non plus.</p>
<p style="text-align: justify;">Le Web, qui par essence provoque des milliers de lecture et interprétation de fichier de programme, utilise un système d’interprétation, ce qui est la pire façon de faire, ce qui est le plus consommateur possible. Voici le paradoxe.</p>
<p style="text-align: justify;">Si je me la faisais à la Yann Arthus-Bertrand, je redirais « alors pourquoi toi, homo sapiens sapiens, ne compile tu pas tes langages Web ?». Es-tu conscient des ressources gâchées par cette hérésie et de l’impact, de l’empreinte carbone, de cette approche incompréhensible ? Tu veux vraiment défoncer les puits de soleil ? Tu es un inconscient pathologique, un criminel notoire, un serial-gâcheur ? Ooops, je m’emporte&#8230; Yann (dont j’aime beaucoup le travail mais un peu moins la voix monocorde) n’irait pas jusque là !</p>
<p style="text-align: justify;">« Pourquoi ne compile t’on pas ? », bon ok, j’arrête de faire mon YAB…</p>
<p style="text-align: justify;">Je n’ai rien contre les développeurs, qui n’y peuvent pas grand-chose si ce n’est optimiser leur code (ca serait déjà un bon début pour certain ceci étant). Ce qui me froisse par contre, c’est que l’on a pas encore de solutions parfaitement mûres pour corriger ce point.</p>
<p style="text-align: justify;">Des soucis assez complexes de conception sont au rendez-vous pour passer du PHP de l’état interprétable à l’état compilé. Mais ne vous y trompez pas, le Graal est au bout de la route.</p>
<p style="text-align: justify;">Plusieurs initiatives sont en cour de développement par des gens talentueux que je ne peux qu’encourager dans cette voie : Roadsend et PHC (Php compiler mais qui paraît à l’arrêt) semblent être les leaders dans cette voie.</p>
<p style="text-align: justify;"><a href="http://www.phpcompiler.org/">http://www.phpcompiler.org/</a></p>
<p style="text-align: justify;"><a href="http://www.roadsend.com/home/index.php?pageID=compiler">http://www.roadsend.com/home/index.php?pageID=compiler</a></p>
<p style="text-align: justify;">L’autre approche possible serait un cache plus efficace, pas uniquement des opcodes comme APC mais bien des pages rendues, du résultat de l’interprétation PHP. C’est ce vers quoi se dirige Zend Server, c’est une bonne première transition mais le compilateur serait bien LA solution !</p>
<p style="text-align: justify;">
<h1><strong>En conclusion</strong></h1>
<p><BR></p>
<p style="text-align: justify;">Je dirais que PHP et surtout le modèle interprété qui va avec et Javascript et surtout l’implémentation qui en ait faite des les navigateurs autant que dans le code de certaines pages Web, sont deux problèmes.</p>
<p style="text-align: justify;">Ces deux axes de progression nous apporteraient un Web plus rapide, souple et agréable d’utilisation. Le réseau n’est plus réellement une limite, les processeurs sont suffisamment puissants alors deux cas sont possibles :</p>
<p style="text-align: justify;">-      Quelques personnes douées arrivent au bout de ces deux problèmes</p>
<p style="text-align: justify;">
<p style="text-align: justify;">-      Tout le monde se contente de ce qu’on a, on enterre la logique d’optimisation de l’époque atari &amp; amiga, on tue les phoques et la banquise en consommant inutilement des ressources informatiques précieuses. On compense par plus de puissance, plus de ressources consommées, plutôt que de mieux utiliser.</p>
<p style="text-align: justify;">
<p style="text-align: justify;">Un classique me direz-vous ?</p>
<p style="text-align: justify;">
]]></content:encoded>
			<wfw:commentRss>http://www.wikigento.com/optimisation-lampzendmagento/javascript-php-performances/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Magento &amp; Zend server : the benchmarks !</title>
		<link>http://www.wikigento.com/test-bench/magento-zend-server-the-benchmarks/</link>
		<comments>http://www.wikigento.com/test-bench/magento-zend-server-the-benchmarks/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 15:10:51 +0000</pubDate>
		<dc:creator>Philippe Humeau</dc:creator>
				<category><![CDATA[Optimisation LAMP/Zend/Magento]]></category>
		<category><![CDATA[Php/Zend/Magento]]></category>
		<category><![CDATA[Test / Bench]]></category>
		<category><![CDATA[Magento and Zend server performances benchmark]]></category>
		<category><![CDATA[Magento Zend server]]></category>
		<category><![CDATA[Zend and Magento]]></category>
		<category><![CDATA[Zend page cache]]></category>
		<category><![CDATA[Zend server benchmark]]></category>
		<category><![CDATA[Zend server performances]]></category>

		<guid isPermaLink="false">http://www.wikigento.com/?p=938</guid>
		<description><![CDATA[Cet article (en anglais) est un benchmark complet des performances comparées des versions 1.2, 1.3 et 1.3 avec flat catalog de Magento. Ensuite Zend server a été ajouté pour améliorer les performances de l'ensemble et des tests ont de nouveau été menées afin de comparer l'ensemble.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify">Bonjour à toutes et à tous,</p>
<p style="text-align: justify">Ce coup-ci l&#8217;article sera en anglais car c&#8217;est une publication d&#8217;un white paper rédigé à l&#8217;origine par <a title="NBS System hébergement et infogérance Magento" href="http://www.nbs-system.com/hebergement">NBS System</a> sur les performances de Magento quand on y couple Zend server. Les tests &amp; benchmarks sont fait entre les versions 1.2, 1.3 et 1.3 avec le flat catalog d&#8217;activé puis avec Zend Server et enfin avec Zend server incluant le page cache (version payante).</p>
<p style="text-align: justify">Ce white paper est en licence Creative commons paternity no commercial use, vous pouvez donc le télécharger, le modifier, le diffuser à votre convenance, sauf pour usage commercial. Celui-ci est uniquement autorisé aux sociétés NBS System, Zend et Varien. <em>(NBS System peut autoriser explicitement l&#8217;usage commercial de ce contenu sur demande)<br />
</em></pre>
<p>Vous pouvez le télécharger dans sa <a title="Magento and Zend server performances benchmark" href="http://www.wikigento.com/wp-content/uploads/2009/07/magento-and-zend-server-benchmarks-june-2009.pdf" target="_blank">version PDF intégrale ici</a>.</p>
<p><a rel="attachment wp-att-939" href="http://www.wikigento.com/?attachment_id=939"><img class="size-full wp-image-939 alignright" title="cc-logo" src="http://www.wikigento.com/wp-content/uploads/2009/07/cc-logo.jpg" alt="cc-logo" width="115" height="40" /></a></p>
<p align="center"><span style="font-size: large;"><span style="font-family: Verdana, &quot;geneva&quot;;"><strong>Magento &amp; Zend Benchmarks</strong></span></span></p>
<p><span style="font-size: large;"> </span></p>
<p><span style="font-size: large;"><span style="font-family: Verdana, &quot;geneva&quot;;"><strong><span style="font-size: large;"> </span></strong></span></span></p>
<p><span style="font-size: large;"> </span></p>
<p align="center"><span style="font-size: large;"><span style="font-family: Verdana, &quot;geneva&quot;;"><strong><span style="font-size: large;">Version 1.2, 1.3 (with &amp; without Flat Catalogs)</span></strong></span></span></p>
<p align="center"><span style="font-size: large;"><span style="font-family: Verdana, &quot;geneva&quot;;"><strong> </strong></span></span></p>
<p align="center"><span style="font-size: large;"><span style="font-family: Verdana, &quot;geneva&quot;;"><strong> </strong></span></span></p>
<h1>1. Foreword</h1>
<p><BR></p>
<p style="text-align: justify">Magento is a PHP/Zend application which intensively uses the CPU. Since version 1.1.6, each new version includes some mechanisms aimed to improve the performances. The goal is to use fewer resources for a given e-shop, which mainly means less CPU, in order to host more users with the same hardware.</p>
<p style="text-align: justify">One key to achieve better performances is how to optimize PHP pages generation and service. "LAMP" servers are well known and usually run Apache server with mod-php, eventually in fast_cgi mod.</p>
<p style="text-align: justify">Zend, the PHP Company, made a specific server (Zend Server), which includes a web application stack that (among other things) improves application performances through page caching and opcode reorganization &amp; acceleration.</p>
<p style="text-align: justify">Apache and Zend Server is an alternative to the usual Apache and mod-php to run Magento, the goal of theses studies &amp; tests is to qualify and estimate the performances added by the use of this software.</p>
<p style="text-align: justify">Many thanks to Yoav Kutner (Varien's CTO) for providing us with prefilled catalogs for 1.2 and 1.3 version of Magento. Thanks goes as well to Zend labs for providing help in configuration and tweaking of the Zend Server as well as explaining the in depth mechanism of the solution.</p>
<p style="text-align: justify"><span id="more-938"></span></p>
<h1>2. Methods &amp; tools used</h1>
<p><BR></p>
<p style="text-align: justify">The benchmarks were done using siege (2.66-2), with different numbers of simultaneous threads (5, 10, 20 and 40). Each thread opens a connection to the web server, request a page, and start again as soon as the page is fetched.</p>
<p style="text-align: justify">Tests were run over 5 minutes each; average pages retrieved was counted for this benchmark.</p>
<p style="text-align: justify">Two kinds of tests were done: the first one is the simplest; we only load the main page in loop, as fast as possible.</p>
<p style="text-align: justify">The second test is based on logs produced by a visit, loading all the data the browser collected (including css, js, images ...). As loading a single page would usually load multiple elements, the number displayed is much higher than the number of pages that would be actually seen by visitors.</p>
<p style="text-align: justify">(18 pages viewed by the user, for 91 items downloaded, a ratio around 5)</p>
<p style="text-align: justify">All results were obtained on the same hardware and operating system, for testing purposes, no reverse proxy was active during the benchmarks but APC code cache was running. This was a "standard", default environment with no special performance tweaks installed.</p>
<h2>Hardware used</h2>
<p>Dual Quad-Core AMD Opteron(tm) Processor 2376 (2.3GHz), 8GB Ram, 15K SAS disks. (Dell PE M605)</p>
<h2>Software context</h2>
<p>Operating system: Linux (2.6.27.10-grsec) on a Debian (lenny)<br />
Web Server: Apache2 (2.2.9-10+lenny2)<br />
PHP (mod-php): mod-php5 (5.2.6.dfsg.1-1+lenny3) / php-apc (3.0.19-2)<br />
PHP (Zend Server): zend-pe (1.0.0-1+b47) / mod-php5-zend-pe (5.2.9+b75)</p>
<h2>Repositories</h2>
<p>deb http://ftp.fr.debian.org/debian/ lenny main<br />
deb http://security.debian.org/ lenny/updates main<br />
deb http://volatile.debian.org/debian-volatile lenny/volatile main<br />
deb http://repos.zend.com/deb/pe pe non-free</p>
<h1>3. Magento Versions benchmarks</h1>
<p><BR></p>
<p style="text-align: justify">Those tests were realized on an 80 000 (later called 80 k) products catalog.</p>
<p style="text-align: justify">Graphs represent the average number of requests successfully loaded from the server per second during the 5 minutes test.</p>
<h2>Loading the homepage</h2>
<p align="center">
<p style="text-align: center;"><img class="size-medium wp-image-949 aligncenter" title="graph1 - Comparison between 1.2, 1.3 and 1.3 + flat catalog" src="http://www.wikigento.com/wp-content/uploads/2009/07/graph1-500x286.jpg" alt="graph1 - Comparison between 1.2, 1.3 and 1.3 + flat catalog" width="500" height="286" /><br />
Magento 1.3 is much faster than 1.2 showing the main page. Flat Catalogs do not help much displaying this homepage, and seems to even slow down a little under heavy loads. The performance between 1.2 and 1.3 is doubled for low charges and is still 33% higher under heavy load.</p>
<p style="text-align: justify">For a standard value, under a "standard" load, we can consider that +40% is a reasonable value when running a 1.3 version instead of a 1.2, at least for the homepage.<strong> </strong></p>
<h2>Full visit cycle</h2>
<p style="text-align: center" align="center"><a rel="attachment wp-att-950" href="http://www.wikigento.com/?attachment_id=950"><img class="aligncenter size-medium wp-image-950" title="Graph2 - Full visit, comparison between 1.2, 1.3 and 1.3 + FC" src="http://www.wikigento.com/wp-content/uploads/2009/07/graph2-500x286.jpg" alt="Graph2 - Full visit, comparison between 1.2, 1.3 and 1.3 + FC" width="500" height="286" /></a></p>
<p style="text-align: justify">The graph shows a slightly smaller increase with 1.3 compared to 1.2 and the flat catalog mechanism give an overall benefit which greatly increases the performances.</p>
<p>For the records, we can reasonably choose to keep theses values in mind:</p>
<p>Version 1.2 -&gt; 1.3 : +66%<br />
Version 1.3 -&gt; 1.3+Flat Catalog : +20%</p>
<h1>4. Apache + mod-php VS Apache + Zend Server</h1>
<p><BR></p>
<p style="text-align: justify">Zend Server (sometimes refered as ZS later on) comes with several built-in technologies for enhancing application performance:</p>
<ul style="text-align: justify">
<li> Zend Optimizer+ performs byte-code optimization and caching. This speeds up PHP applications by eliminating the process of reading scripts from disk and compiling them. Zend Optimizer+ runs automatically, and installing your application on top of Zend Server (ZS) is all you need to do in order to enjoy its benefits. During the test with ZS, APC Code cache is deactivated as Zend optimizer+ is doing the same job.</li>
<li> Zend Page Cache allows caching of complete PHP pages. Page Caching greatly improves the performance of web applications while maintaining dynamic capabilities through an elaborate system of caching rules that could be based on request parameters and user session data. Page Caching also has the benefit of not requiring any code changes, and can be set up from the Zend Server UI. Only the "pro" version contains this precise piece of software which definitely makes a difference as we will see in a minute.</li>
<li> Zend Data Cache is a set of API functions enabling a developer to store and manage data items (PHP strings, arrays and other data) and even output elements in either disk-based cache or shared memory cache. Zend Data Cache allows for precision-guided caching when Page Caching is not an option. The provided API is easy-to-use on existing code, and in many cases a developer can skip existing code sections by simply wrapping them with caching APIs. This precise piece of software would benefit from a little remastering of the code by Varien to really achieve a full support of this functionality. If done, we can imagine selectively flushing the cache when changing some pages on the servers and not destroying the whole Magento cache thus doing a "cold cache start" after a new functionality is put online.</li>
</ul>
<p style="text-align: justify"><strong><br />
Note: </strong>Zend Optimizer+ and Zend Data Cache are available in the free, community version of Zend Server, while Zend Page Cache requires a licensed Zend Server (full comparison of Zend Server and Zend Server Community Edition is located at <a href="http://www.zend.com/fr/products/server/editions">http://www.zend.com/fr/products/server/editions</a>).</p>
<h2><strong>Zend Server Configuration for Magento</strong></h2>
<p>In the benchmark, two caching rules have been defined:<br />
The first rule caches the JavaScript files which are dynamically merged into one request by Magento.<br />
This simple rule results in a very substantial improvement to response times.</p>
<p align="center"><img class="aligncenter size-medium wp-image-952" title="ZS - configuration screen shot 1" src="http://www.wikigento.com/wp-content/uploads/2009/07/sc11-500x327.jpg" alt="ZS - configuration screen shot 1" width="500" height="327" /></p>
<p style="text-align: justify">The second rule caches all web pages accessed by users who have nothing in their shopping carts or history (when the shopping cart is not empty or when the user history is saved, there is no point in page caching). As you can see in the screen capture below, this is accomplished by looking at $_SESSION variables and by splitting according to $_SERVER['REQUEST_URI'] in addition to the QUERY_STRING.</p>
<p align="center"><a rel="attachment wp-att-953" href="http://www.wikigento.com/?attachment_id=953"><img class="aligncenter size-medium wp-image-953" title="ZS - configuration screenshot 2" src="http://www.wikigento.com/wp-content/uploads/2009/07/sc2-499x427.jpg" alt="ZS - configuration screenshot 2" width="499" height="427" /></a></p>
<p>Finally, Zend Optimizer+ has been enabled for optimizing and caching the PHP byte-code.</p>
<p style="text-align: justify">As you can see, Zend Page Cache seems a very powerful feature. It needs fine tuning and better configuration, but let's see results :</p>
<h2>Homepage / 80 000 products catalog</h2>
<p style="text-align: center" align="center">
<p align="center"><a rel="attachment wp-att-954" href="http://www.wikigento.com/?attachment_id=954"><img class="size-medium wp-image-954 aligncenter" title="Graph3 : comparison between 1.3, 1.3 + FC, 1.3+ZS, 1.3+FC+ZS" src="http://www.wikigento.com/wp-content/uploads/2009/07/graph3-499x254.jpg" alt="Graph3 : comparison between 1.3, 1.3 + FC, 1.3+ZS, 1.3+FC+ZS" width="499" height="254" /></a></p>
<p style="text-align: justify">Load on main page doesn't prove very constructive, although, on heavy load (40 concurrent requests), Zend Server (with or without page cage) is slightly better than basic mod-php, but almost no real improvements on this test. A 5% or less win is not to be taken seriously as it is the error margin of the tests.</p>
<h2>Full visit / 80k products</h2>
<p style="text-align: center" align="center"><a rel="attachment wp-att-958" href="http://www.wikigento.com/?attachment_id=958"><img class="size-medium wp-image-958 aligncenter" title="Graph4 : Full visit, 80K product comparison chart" src="http://www.wikigento.com/wp-content/uploads/2009/07/graph4-499x254.jpg" alt="Graph4 : Full visit, 80K product comparison chart" width="499" height="254" /></a></p>
<p style="text-align: justify">Full visit graphic speaks for itself, whatever the load, Zend Server with Page Cache and Flat Catalog make a big difference.</p>
<p style="text-align: justify">Comparing a 1.3 with flat catalog with a the same configuration but with a Zend Community installed instead of just APC, our server yield up to 15% more performances, just using a free edition of ZS.</p>
<p style="text-align: justify">If we use a full Zend server (the licensed one including the page cache) on this 1.3 flat catalog, our server goes up to 30% more performances!</p>
<p>Mod PHP + APC -&gt; ZS: +15%<br />
Mod PHP + APC -&gt; ZS licensed edition: +30%</p>
<h1>5. Response time</h1>
<p><BR></p>
<h2>Homepage / 80k products</h2>
<p align="center"><a rel="attachment wp-att-959" href="http://www.wikigento.com/?attachment_id=959"><img class="aligncenter size-medium wp-image-959" title="Graph5 : load time !" src="http://www.wikigento.com/wp-content/uploads/2009/07/graph5-500x244.jpg" alt="Graph5 : load time !" width="500" height="244" /></a></p>
<p style="text-align: justify">This graph show response time on the homepage measured during a load. No match on this test, under a good load, ZS, community or licensed edition, gives up a 35% boost in the load time, good to take.</p>
<h2>Full visit / 80k products</h2>
<p style="text-align: center"><a rel="attachment wp-att-961" href="http://www.wikigento.com/?attachment_id=961"><img class="size-medium wp-image-961 aligncenter" title="Graph6 : full navigation load time comparison chart" src="http://www.wikigento.com/wp-content/uploads/2009/07/graph61-500x244.jpg" alt="Graph6 : full navigation load time comparison chart" width="500" height="244" /></a></p>
<p style="text-align: justify">Page Cache provides a better response time over a full visit of the site, even under very heavy load. As the difference remains thin, I would conclude it to be identical in that condition. However, the benefits of the page cache under a standard load remains a must have. Once again, a 35% win is to be considered as a reference value under a good load whether you are using a community or licensed version.</p>
<p style="text-align: justify">Under medium or light load, the page cache is giving a lot more power than the community edition can do. This strange result is probably mainly due to the page cache mechanism which prove to be not that efficient under heavy load because the system is using its resource in a different way.<br />
We didn't had time to check if it was a False cache sharing effect on L2 or L3 processor cache or a Linux or ZS issue but the test has been runned several times yielding the same results.</p>
<p style="text-align: justify">So keep in mind that the benefits of the ZS Page cache mechanism is going to be less and less active as the server load gets high. Under a usual load, a reasonable load lets say, the Page Cache algorithm gives a nice boost to the loading time, driving it down for ~40%.</p>
<h1>6. Additional technical details about the tests</h1>
<p><BR></p>
<h2>Sample data</h2>
<p>All tests were run with generated sample data (provided by Varien)</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="text-align: center" width="213" valign="top">Parameter</td>
<td style="text-align: center" width="213" valign="top">10k</td>
<td style="text-align: center" width="213" valign="top">80k</td>
</tr>
<tr>
<td style="text-align: center" width="213" valign="top">Categories</td>
<td style="text-align: center" width="213" valign="top">251</td>
<td style="text-align: center" width="213" valign="top">1576</td>
</tr>
<tr>
<td style="text-align: center" width="213" valign="top">Category * product associations</td>
<td style="text-align: center" width="213" valign="top">24690</td>
<td style="text-align: center" width="213" valign="top">202743</td>
</tr>
<tr>
<td style="text-align: center" width="213" valign="top">Products</td>
<td style="text-align: center" width="213" valign="top">10001</td>
<td style="text-align: center" width="213" valign="top">78994</td>
</tr>
</tbody>
</table>
<h2>Description of the tests</h2>
<h3>Main page test</h3>
<p>Each concurrent thread loads the main page, without storing the cookies to simulate simultaneous users.</p>
<h3>Full visit test</h3>
<p style="text-align: justify">We have a list requests based on a visit done with a real browser. Each concurrent thread loads each item one after another as fast as possible, and restarts after deleting all its cookies. This simulates simultaneous users, except that simultaneous.</p>
<p>List of requested pages for the 80k database (with POST information when it applies):</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p938code1'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p9381"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
</pre></td><td class="code" id="p938code1"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>span <span style="color: #007800;">style</span>=<span style="color: #ff0000;">&quot;font-size: xx-small;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>favicon.ico<span style="color: #000000; font-weight: bold;">&lt;/</span>span<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>span <span style="color: #007800;">style</span>=<span style="color: #ff0000;">&quot;font-size: xx-small;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>js<span style="color: #000000; font-weight: bold;">/</span>index.php?<span style="color: #007800;">c</span>=auto<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">f</span>=,prototype<span style="color: #000000; font-weight: bold;">/</span>prototype.js,prototype<span style="color: #000000; font-weight: bold;">/</span>validation.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>builder.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>effects.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>dragdrop.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>controls.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>slider.js,varien<span style="color: #000000; font-weight: bold;">/</span>js.js,varien<span style="color: #000000; font-weight: bold;">/</span>form.js,varien<span style="color: #000000; font-weight: bold;">/</span>menu.js,mage<span style="color: #000000; font-weight: bold;">/</span>translate.js,mage<span style="color: #000000; font-weight: bold;">/</span>cookies.js
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>css<span style="color: #000000; font-weight: bold;">/</span>reset.css
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>css<span style="color: #000000; font-weight: bold;">/</span>menu.css
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>css<span style="color: #000000; font-weight: bold;">/</span>print.css
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>css<span style="color: #000000; font-weight: bold;">/</span>clears.css
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>css<span style="color: #000000; font-weight: bold;">/</span>boxes.css
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>body_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>logo.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>btn_mini_search.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>mini_search_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>nav_bg.jpg
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>nav_divider.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>main_container_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>shop_access_pipe.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>base_mini_head_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>col_left_callout.jpg
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>header_top_container_bg.jpg
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>icon_table.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>icon_newspaper.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>icon_tag_green.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>icon_basket.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>col_right_callout.jpg
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>footer_info_separator.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>main_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>category-<span style="color: #000000;">736</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>layered_nav_head_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>layered_nav_narrowed_category_heading.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>narrow_by_set.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>narrow_by_dd_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>pager_arrow_right.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>sort_asc_arrow.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span>1small_image<span style="color: #000000; font-weight: bold;">/</span>135x135<span style="color: #000000; font-weight: bold;">/</span>5e06319eda06f020e43594a9c230972d<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>placeholder<span style="color: #000000; font-weight: bold;">/</span>small_image.jpg
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>pager_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>category-<span style="color: #000000;">736</span>?<span style="color: #007800;">attribute_864</span>=<span style="color: #000000;">306</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>list_remove_btn.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>narrow_category_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>narrow_by_li_by.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>category-<span style="color: #000000;">736</span>?<span style="color: #007800;">attribute_864</span>=<span style="color: #000000;">306</span><span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">price</span>=<span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">%</span>2C100
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>category-<span style="color: #000000;">736</span>?<span style="color: #007800;">attribute_864</span>=<span style="color: #000000;">306</span><span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">price</span>=<span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">%</span>2C100<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">p</span>=<span style="color: #000000;">2</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>pager_arrow_left.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>category-<span style="color: #000000;">736</span>?<span style="color: #007800;">attribute_864</span>=<span style="color: #000000;">306</span><span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">price</span>=<span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">%</span>2C100<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">p</span>=<span style="color: #000000;">3</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>category-<span style="color: #000000;">736</span><span style="color: #000000; font-weight: bold;">/</span>gtx14049.html
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>js<span style="color: #000000; font-weight: bold;">/</span>index.php?<span style="color: #007800;">c</span>=auto<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">f</span>=,prototype<span style="color: #000000; font-weight: bold;">/</span>prototype.js,prototype<span style="color: #000000; font-weight: bold;">/</span>validation.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>builder.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>effects.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>dragdrop.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>controls.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>slider.js,varien<span style="color: #000000; font-weight: bold;">/</span>js.js,varien<span style="color: #000000; font-weight: bold;">/</span>form.js,varien<span style="color: #000000; font-weight: bold;">/</span>menu.js,mage<span style="color: #000000; font-weight: bold;">/</span>translate.js,mage<span style="color: #000000; font-weight: bold;">/</span>cookies.js,varien<span style="color: #000000; font-weight: bold;">/</span>product.js,calendar<span style="color: #000000; font-weight: bold;">/</span>calendar.js,calendar<span style="color: #000000; font-weight: bold;">/</span>lang<span style="color: #000000; font-weight: bold;">/</span>calendar-en.js,calendar<span style="color: #000000; font-weight: bold;">/</span>calendar-setup.js
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>js<span style="color: #000000; font-weight: bold;">/</span>calendar<span style="color: #000000; font-weight: bold;">/</span>calendar-win2k-<span style="color: #000000;">1</span>.css
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>image<span style="color: #000000; font-weight: bold;">/</span>265x<span style="color: #000000; font-weight: bold;">/</span>5e06319eda06f020e43594a9c230972d<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>placeholder<span style="color: #000000; font-weight: bold;">/</span>image.jpg
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>product_essential_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>product_collateral_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>dotted_divider.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>icon_tag_add.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>checkout<span style="color: #000000; font-weight: bold;">/</span>cart<span style="color: #000000; font-weight: bold;">/</span>add<span style="color: #000000; font-weight: bold;">/</span>uenc<span style="color: #000000; font-weight: bold;">/</span>aHR0cDovL3Rlc3RtMTIudGVzdC5uYnMtc3lzdGVtLmNvbS9jYXRlZ29yeS03MzYvZ3R4MTQwNDkuaHRtbD9fX19TSUQ9VQ,,<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">67952</span><span style="color: #000000; font-weight: bold;">/</span> POST <span style="color: #007800;">product</span>=<span style="color: #000000;">67952</span><span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">related_product</span>=<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">qty</span>=
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>checkout<span style="color: #000000; font-weight: bold;">/</span>cart<span style="color: #000000; font-weight: bold;">/</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>js<span style="color: #000000; font-weight: bold;">/</span>index.php?<span style="color: #007800;">c</span>=auto<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">f</span>=,prototype<span style="color: #000000; font-weight: bold;">/</span>prototype.js,prototype<span style="color: #000000; font-weight: bold;">/</span>validation.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>builder.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>effects.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>dragdrop.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>controls.js,scriptaculous<span style="color: #000000; font-weight: bold;">/</span>slider.js,varien<span style="color: #000000; font-weight: bold;">/</span>js.js,varien<span style="color: #000000; font-weight: bold;">/</span>form.js,varien<span style="color: #000000; font-weight: bold;">/</span>menu.js,mage<span style="color: #000000; font-weight: bold;">/</span>translate.js,mage<span style="color: #000000; font-weight: bold;">/</span>cookies.js,varien<span style="color: #000000; font-weight: bold;">/</span>weee.js
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>btn_proceed_to_checkout.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>btn_trash.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>thumbnail<span style="color: #000000; font-weight: bold;">/</span>75x<span style="color: #000000; font-weight: bold;">/</span>5e06319eda06f020e43594a9c230972d<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>placeholder<span style="color: #000000; font-weight: bold;">/</span>thumbnail.jpg
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>success_msg_icon.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>icon_asterick.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>icon_lorry.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>data_table_th_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>base_mini_actions_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>category-<span style="color: #000000;">736</span><span style="color: #000000; font-weight: bold;">/</span>gtx14049.html
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>thumbnail<span style="color: #000000; font-weight: bold;">/</span>50x50<span style="color: #000000; font-weight: bold;">/</span>5e06319eda06f020e43594a9c230972d<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>placeholder<span style="color: #000000; font-weight: bold;">/</span>thumbnail.jpg
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>category-<span style="color: #000000;">1497</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>small_image<span style="color: #000000; font-weight: bold;">/</span>135x135<span style="color: #000000; font-weight: bold;">/</span>5e06319eda06f020e43594a9c230972d<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>placeholder<span style="color: #000000; font-weight: bold;">/</span>small_image.jpg
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>category-<span style="color: #000000;">1497</span>?<span style="color: #007800;">attribute_864</span>=<span style="color: #000000;">305</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>category-<span style="color: #000000;">1497</span><span style="color: #000000; font-weight: bold;">/</span>npt25-a.html
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>image<span style="color: #000000; font-weight: bold;">/</span>265x<span style="color: #000000; font-weight: bold;">/</span>5e06319eda06f020e43594a9c230972d<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>placeholder<span style="color: #000000; font-weight: bold;">/</span>image.jpg
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>checkout<span style="color: #000000; font-weight: bold;">/</span>cart<span style="color: #000000; font-weight: bold;">/</span>add<span style="color: #000000; font-weight: bold;">/</span>uenc<span style="color: #000000; font-weight: bold;">/</span>aHR0cDovL3Rlc3RtMTIudGVzdC5uYnMtc3lzdGVtLmNvbS9jYXRlZ29yeS0xNDk3L25wdDI1LWEuaHRtbD9fX19TSUQ9VQ,,<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">25870</span><span style="color: #000000; font-weight: bold;">/</span> POST <span style="color: #007800;">product</span>=<span style="color: #000000;">25870</span><span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">related_product</span>=<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">qty</span>=
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>checkout<span style="color: #000000; font-weight: bold;">/</span>cart<span style="color: #000000; font-weight: bold;">/</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>thumbnail<span style="color: #000000; font-weight: bold;">/</span>75x<span style="color: #000000; font-weight: bold;">/</span>5e06319eda06f020e43594a9c230972d<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>placeholder<span style="color: #000000; font-weight: bold;">/</span>thumbnail.jpg
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>category-<span style="color: #000000;">3</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>thumbnail<span style="color: #000000; font-weight: bold;">/</span>50x50<span style="color: #000000; font-weight: bold;">/</span>5e06319eda06f020e43594a9c230972d<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>placeholder<span style="color: #000000; font-weight: bold;">/</span>thumbnail.jpg
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>category-<span style="color: #000000;">3</span>?<span style="color: #007800;">price</span>=<span style="color: #000000;">4</span><span style="color: #000000; font-weight: bold;">%</span>2C1000
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>checkout<span style="color: #000000; font-weight: bold;">/</span>cart<span style="color: #000000; font-weight: bold;">/</span>add<span style="color: #000000; font-weight: bold;">/</span>uenc<span style="color: #000000; font-weight: bold;">/</span>aHR0cDovL3Rlc3RtMTIudGVzdC5uYnMtc3lzdGVtLmNvbS9jYXRlZ29yeS0zP3ByaWNlPTQlMkMxMDAwJmNhdD0zNyZfX19TSUQ9VQ,,<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">4642</span><span style="color: #000000; font-weight: bold;">/</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>checkout<span style="color: #000000; font-weight: bold;">/</span>cart<span style="color: #000000; font-weight: bold;">/</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>checkout<span style="color: #000000; font-weight: bold;">/</span>onepage<span style="color: #000000; font-weight: bold;">/</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>js<span style="color: #000000; font-weight: bold;">/</span>varien<span style="color: #000000; font-weight: bold;">/</span>accordion.js
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>js<span style="color: #000000; font-weight: bold;">/</span>opcheckout.js
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>opc_off_head_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>opc-ajax-loader.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>btn_window_close.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>cvv.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>multi_address_box_bg.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>skin<span style="color: #000000; font-weight: bold;">/</span>frontend<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>btn_place_order.gif
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>catalogsearch<span style="color: #000000; font-weight: bold;">/</span>ajax<span style="color: #000000; font-weight: bold;">/</span>suggest<span style="color: #000000; font-weight: bold;">/</span> POST <span style="color: #007800;">q</span>=<span style="color: #000000;">45</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>catalogsearch<span style="color: #000000; font-weight: bold;">/</span>ajax<span style="color: #000000; font-weight: bold;">/</span>suggest<span style="color: #000000; font-weight: bold;">/</span> POST <span style="color: #007800;">q</span>=<span style="color: #000000;">456</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>catalogsearch<span style="color: #000000; font-weight: bold;">/</span>result<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #007800;">q</span>=<span style="color: #000000;">456</span><span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">x</span>=<span style="color: #000000;">17</span><span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">y</span>=<span style="color: #000000;">8</span>
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>small_image<span style="color: #000000; font-weight: bold;">/</span>135x135<span style="color: #000000; font-weight: bold;">/</span>5e06319eda06f020e43594a9c230972d<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>placeholder<span style="color: #000000; font-weight: bold;">/</span>small_image.jpg
http:<span style="color: #000000; font-weight: bold;">//</span>test80k<span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>thumbnail<span style="color: #000000; font-weight: bold;">/</span>50x50<span style="color: #000000; font-weight: bold;">/</span>5e06319eda06f020e43594a9c230972d<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>catalog<span style="color: #000000; font-weight: bold;">/</span>product<span style="color: #000000; font-weight: bold;">/</span>placeholder<span style="color: #000000; font-weight: bold;">/</span>thumbnail.jpg<span style="color: #000000; font-weight: bold;">&lt;/</span>span<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p><BR><br />
<h1>7. Things to test in the next benchmark campaign</h1>
<p><BR></p>
<h2>Mage Compiler</h2>
<p>When running all those tests, 1.3.1.1 version including the Mage optimizer was about to be released and an immediate 1.3.1.2 version followed and we didn't had time to include some tests around this precise point. Let's just consider the fact that this mechanism is mainly made to lower I/O jobs by "compiling" the libraries files all in one or two includes only. If your servers were already using mainly their RAM to work, the performances increase will not be that valuable. But if your servers where low on RAM or using mainly their disks, you should feel confident with using this option which can do great good to your performances!</p>
<h2>Nginx</h2>
<p>We didn't had the required time to consolidate the results involving Nginx + PHP tests. This solution ranked almost every time between Magento 1.3 + FC and Magento 1.3 + Zend server (without Page cache). So this combination yield average performances, not as sharp as a Magento 1.3 + Zend server or any more advanced combination.</p>
<h2>More "customed" visits</h2>
<p>We have used a scenario involving each time a research in the search bar of the website and some "standard" behaviors. A more precise test can be run replaying some real traffic pumped up from apache log on a real site, the customer's behaviors being more realistic even if our scenario was as logical as possible.</p>
<h1>8. Conclusion</h1>
<p><BR><br />
First, let me say that no electrons were armed or injured during these benchmarks. Perhaps one or two CTO were put under constraint and continuous coffee perfusions but all of this was intend for the greater good of E-commerce!</p>
<p>If you wish a more professional conclusion, let's say that using ZS community edition will only do you good and really can replace APC.</p>
<p>If using the licensed version, the Page cache is very efficient (under reasonable load of the servers) and can help using ~25% less machines to achieve similar hosting capacities. If your servers are billed in a "managed hosting" way, having one or two less servers billed per month can make a good difference in the budget.</p>
<p>About Zend Server : this software has many other great functionalities and this paper is only consider the "performances" issues, just pay a visit to Zend Website for a far more complete overview of the product.</p>
<p>Last but not least, creating a server with all optimizations and best practices, based on an a dual AMD 2376 with 8 Go of RAM and using ZS and page cache, you can try to reach up to ~40 000 unique visitors a day corresponding to ~2 500 Magento simultaneous session at maximum load. (if database is separated on a different server and you activate a reverse proxy like Squid or Varnish above your front web servers)<br />
This estimation is deeply linked to the website complexity and user standard behavior but these figures are given for a "standard" site and use, you can usually also expect a ~2 seconds loading time on the homepage.</p>
<p>If we had to sum up a quick dirty, average table of the performances, without any details, we would give that:<a rel="attachment wp-att-981" href="http://www.wikigento.com/?attachment_id=981"><img class="aligncenter size-full wp-image-981" title="graph71" src="http://www.wikigento.com/wp-content/uploads/2009/07/graph71.jpg" alt="graph71" width="259" height="100" /></a></p>
<p>© June 2009, NBS Team,</p>
<p><a href="mailto:rene.amirkhanian@nbs-system.com">René Amirkhanian</a>, <a href="mailto:adrien.urban@nbs-system.com">Adrien Urban</a>, <a href="mailto:philippe.humeau@nbs-system.com">Philippe Humeau</a>,<br />
you can visit us here: <a href="http://www.nbs-system.com/">www.nbs-system.com</a><br />
and reach us at: <a href="mailto:contact@nbs-system.com">contact@nbs-system.com</a> for any comments or corrections (and yes, we do hosting <img class="superemotions" title="Big Grin" alt="Big Grin" border="0" src="http://www.wikigento.com/wp-includes/images/smilies/icon_biggrin.gif" />)</p>
<h1>9. Creative Commons</h1>
<p><BR></p>
<p style="text-align: justify;">This document is released under the creative common license "Attribution-Noncommercial-Share Alike 3.0". Only three companies (NBS System, Zend and Varien) are allowed to use it for commercial purposes.</p>
<p><a rel="attachment wp-att-939" href="http://www.wikigento.com/?attachment_id=939"><img class="aligncenter size-full wp-image-939" title="cc-logo" src="http://www.wikigento.com/wp-content/uploads/2009/07/cc-logo.jpg" alt="cc-logo" width="115" height="40" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.wikigento.com/test-bench/magento-zend-server-the-benchmarks/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Qu&#8217;attendre de Mage_Compiler ?</title>
		<link>http://www.wikigento.com/optimisation-lampzendmagento/quattendre-de-mage_compiler/</link>
		<comments>http://www.wikigento.com/optimisation-lampzendmagento/quattendre-de-mage_compiler/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 13:39:09 +0000</pubDate>
		<dc:creator>Philippe Humeau</dc:creator>
				<category><![CDATA[Optimisation LAMP/Zend/Magento]]></category>
		<category><![CDATA[compileur magento]]></category>
		<category><![CDATA[Mage compiler]]></category>
		<category><![CDATA[magento compiler]]></category>
		<category><![CDATA[mage_compiler]]></category>

		<guid isPermaLink="false">http://www.wikigento.com/?p=900</guid>
		<description><![CDATA[Mage_compiler améliore les performances, mais dans quelle mesure ?]]></description>
			<content:encoded><![CDATA[<h1>Mage_compiler : une bonne nouvelle à deux titres</h1>
<p><BR></p>
<p style="text-align: justify;">Même si les débuts de Mage_compiler sont discrêts, cette nouvelle option est un bon signal de plus :</p>
<p>1°) Varien signe ici un mouvement supplémentaire dans le sens de l&#8217;optimisation des performances et depuis la 1.1.6, toutes les versions prennent cette direction. On arrive à un point où le gain cumulé approche les 35 à 70% selon les sites.</p>
<p>Magento est très largement plus fonctionnel et avancé qu&#8217;Os commerce, d&#8217;où la nécessité d&#8217;avoir plus de puissance pour le suivre. Rien de si illogique à cela. En version 1.0.0 on avait un facteur ~6, on en est à un facteur ~2/3. En huit mois, chapeau bas. La bonne nouvelle c&#8217;est que l&#8217;on gagne en performance, de manière continue et que ce chemin est bien un point majeur pour Varien.</p>
<p style="text-align: justify;">2°) C&#8217;est une solution qui va permettre aux serveurs &laquo;&nbsp;standards&nbsp;&raquo; et aux petites infrastructures de gagner en performance de manière sensible.</p>
<h1>Comment ca marche</h1>
<p><BR></p>
<p style="text-align: justify;">
Vous pouvez l&#8217;activer dans le back office en version 1.3.2.1 ou supérieur. Une fois ceci fait, Mage_compiler va en fait concaténer les fichiers liés à Magento en deux librairies et ainsi soulager considérablement les I/O (Input/Output) sur les disques des serveurs.</p>
<p style="text-align: justify;">En effet, l&#8217;organisation du code en librairie et en fichiers facilite la maintenance mais complique la vie des machines. Charger un fichier commence par l&#8217;ouverture d&#8217;un handler, la sequence de lecture, potentiellement la fermeture de ce handler et ceci mutiplié par des centaines voir des milliers de fichiers. Toute économie sur ce point est donc sensible.</p>
<p style="text-align: justify;">Mage_compiler &laquo;&nbsp;compile&nbsp;&raquo; enfin plus exactement regroupe (merge) ces nombreux fichiers afin de soulager le système de tous ces chargements.</p>
<p style="text-align: justify;">Si l&#8217;on a une machine avec peu de mémoire et/ou des disques peu rapides, le gain sera très sensible, peut être jusqu&#8217;à 30% voir 40% car les fichiers ne peuvent rester en mémoire avec peu de RAM, il faut donc souvent les charger. Si le disque est lent, cette opération est couteuse.</p>
<p style="text-align: justify;">Si votre infrastructure était déjà doté de serveur avec beaucoup de RAM qui ne décharge pour ainsi dire jamais des fichiers, le gain sera faible, de l&#8217;ordre de 5% maximum. De la même façon si vous avez des rolls de disques durs en 15 000 tours / minutes en SAS, il y a peu de chance que votre gain dépasse les 10%, même avec peu de RAM.</p>
<p style="text-align: justify;">Les grands gagnants de cette version seront donc les serveurs bas ou moyen de gamme, soit dotés de peu de RAM (moins de 2 Go) soit dotés de disques lents (SATA en 7200 T/m) voir les deux.</p>
<p>J&#8217;espère avoir le temps prochainement de vous proposer des valeurs plus concrêtes en termes de gain de performances, après quelques benchs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wikigento.com/optimisation-lampzendmagento/quattendre-de-mage_compiler/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Construire son infrastructure Magento, partie 1/3 : firewall / RProxy / load balancer</title>
		<link>http://www.wikigento.com/optimisation-systeme-reseau/construire-son-infrastructure-magento-partie-13-firewall-rproxy-load-balancer/</link>
		<comments>http://www.wikigento.com/optimisation-systeme-reseau/construire-son-infrastructure-magento-partie-13-firewall-rproxy-load-balancer/#comments</comments>
		<pubDate>Fri, 22 May 2009 12:55:35 +0000</pubDate>
		<dc:creator>Philippe Humeau</dc:creator>
				<category><![CDATA[Optimisation LAMP/Zend/Magento]]></category>
		<category><![CDATA[Optimisation Système & Réseau]]></category>
		<category><![CDATA[admin système & réseau]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[firewall magento]]></category>
		<category><![CDATA[firewall reverse proxy load balancer]]></category>
		<category><![CDATA[load balancer]]></category>
		<category><![CDATA[load balancer magento]]></category>
		<category><![CDATA[memcached magento]]></category>
		<category><![CDATA[reverse proxy]]></category>
		<category><![CDATA[reverse proxy magento]]></category>
		<category><![CDATA[squid magento]]></category>

		<guid isPermaLink="false">http://www.wikigento.com/?p=656</guid>
		<description><![CDATA[Installation et paramétrage d'un Firewall / Reverse Proxy / load balancer pour une infrastructure Magento.]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p><BR></p>
<p style="text-align: justify">Cet article est le premier d&#8217;une série de 3 sur la configuration d&#8217;un infrastructure Magento complète, comprenant pour l&#8217;exemple un serveur qui sera Firewall/Reverse proxy/Load Balancer, deux autres qui seront des Serveur Web frontaux et un quatrième qui sera en  charge de la base de données.</p>
<h2>Plan des posts<span style="text-decoration: underline;"> </span></h2>
<p style="text-align: justify">1/3 : Configuration du firewall, du load balancer et du Rproxy<br />
2/3 : Configuration des serveurs Web (APC / Apache / PHP)<br />
3/3 : Configuration de la base de données  (Mysql)<br />
<span style="text-decoration: underline;"><br />
</span></p>
<h2><span style="text-decoration: underline;"> </span>Le setup de l&#8217;infrastructure Magento</h2>
<p style="text-align: justify"><a rel="attachment wp-att-789" href="http://www.wikigento.com/?attachment_id=789"><img class="alignleft size-medium wp-image-789" title="archi de base" src="http://www.wikigento.com/wp-content/uploads/2009/05/schema1-305x500.jpg" alt="archi de base" width="305" height="500" /></a>Internet, routeurs et hop, on tombe sur quoi ?</p>
<p style="text-align: justify">Le Firewall, reverse proxy, load balancer.</p>
<p style="text-align: justify">Le premier élément réellement intelligent et puissant sur  lequel on va pouvoir travailler, le premier serveur quoi. Parfois l&#8217;élément Firewall est séparé et repose sur une appliance en amont mais dans le principe, si vous faites dans le full opensource, vous aimez netfilter et donc le firewall de Linux.</p>
<p style="text-align: justify">C&#8217;est par ailleurs un excellent Firewall, je vais donc l&#8217;intégrer à ce petit tuto et même démarrer par là !</p>
<p style="text-align: justify">Pour cet exemple et le paramétrage des fichiers de configuration, le firewall/RP/LB est en 192.168.1.1, les serveurs Web sont en 192.168.1.2 et .3 et la DB est en 192.168.1.4 et le magasin &laquo;&nbsp;virtuel&nbsp;&raquo; s&#8217;appel www.demostore.fr.</p>
<p style="text-align: justify">Enfin, cote ip publique, j&#8217;ai utilisé 33.44.55.66 comme étant celle de demostore.fr et 88.77.111.222 comme étant celle des admins. Vous trouverez ces paramètres dans les fichiers de configuration du firewall, du reverse proxy et du load balancer, il faudra les modifier pour vos besoins.</p>
<p style="text-align: justify">
<p><BR><br />
<BR></p>
<h2>Points non couverts dans ces 3 articles</h2>
<p style="text-align: justify">Je vais me la jouer un peu à la Ruquier, donc ce soir, on ne recevra pas, euh pardon, dans cette série de 3 articles, on ne verra pas :</p>
<ul>
<li>Comment faire de la redondance mutli datacenter avec BGP et les synchros de sites &amp; de DB</li>
<li>Comment séparer les flux de bases de données en écriture &amp; lecture sur deux DB</li>
<li>Comment faire du Master/Master Master/Slave ou du Cluster en Mysql</li>
<li>Comment isoler le backoffice en terme de performances sur les serveurs frontaux</li>
<li>Comment isoler le backoffice en terme d&#8217;accès aux bases de données</li>
</ul>
<p style="text-align: justify;"><span style="text-decoration: underline;">On ne verra pas tout cela car :</span><br />
D&#8217;une part parce que cela serait très long et très complexe à expliquer et que les compétences nécessaires pour faire le tour du sujet sont très vastes. D&#8217;autre part parce que ca va déjà faire un bon volume à rédiger et donc que ca va prendre du temps. Et enfin parce que ces points sont très critiques sur le terrain commercial et qu&#8217;ils sont actuellement des avantages en faveur de ma société vis à vis de ses concurrents.</p>
<p style="text-align: justify">Vu que la concurrence dans le milieu de l&#8217;infogérance Magento est assez active, ma société <a title="NBS System, infogérance Magento" href="http://www.nbs-system.com/hebergement" target="_blank">NBS System</a> ne peux pas se permettre de révéler ses tous derniers tricks ou ses toutes dernières optimisations pour l&#8217;infogérance ou l&#8217;hébergemnt de Magento, mais ce qui sera décrit dans les 5 articles correspond à ce que nous utilisions fin décembre 2008, donc des configurations tout à fait décentes et efficaces.</p>
<p style="text-align: justify;">
En plus mes collègues bossent en ce moment même avec Zend pour faire un papier très complet sur les performances et l&#8217;optimisation avec ZAS (Zend Application Server), je ne vais donc pas dévoiler de secrets avant la publication officielle au <a title="Bargento 2" href="http://www.bargento.fr" target="_blank">Bargento 2</a>.</p>
<h2>Préambule sur GRSEC/PAX</h2>
<p style="text-align: justify;">
Autre point, c&#8217;est peu décrit dans cet article mais plus dans un autre dont je donne le lien et aussi sur le net : <strong><span style="text-decoration: underline;">GRSEC + PAX c&#8217;est l&#8217;assurance vie de vos serveurs</span></strong>. Ce n&#8217;est pas une option : c&#8217;est un pré-requis. Grsec/Pax impose de recompiler le kernel, tache un peu complexe quand on a pas l&#8217;habitude mais le couple vous protège à 99,999% contre tous les overflow, les off by one et autres cochonneries de ce genre. Que ce soit apache, mysql, php, squid, memcached, apc etc&#8230; tous ces applicatifs peuvent avoir un jour une faille de sécurité. Grsec c&#8217;est l&#8217;assurance que même si ca se produit (et ca se produira), vos serveurs ne seront pas compromis.</p>
<h1>Le Firewall</h1>
<p><BR></p>
<h2>Configuration simple</h2>
<p style="text-align: justify">J&#8217;ai réalisé, il y a (très) longtemps de cela, <a title="Iptables et netfilter" href="http://www.nbs-system.com/dossiers/howto-iptables.html" target="_blank">un petit tutoriel pour prendre Iptables &amp; Netfilter en main</a>. Il est incomplet, très vieux, contient des erreurs ou des abbérations que je n&#8217;ai pas eu le temps de corriger dans les scripts mais les explications et schémas sont corrects. <em>Vous remarquerez au passage ma maîtrise considérable dans la création de page Web, celle-ci à faillit avoir de nombreuses récompenses pour l&#8217;utilisation audacieuse des CSS, mais finalement le jury a préféré un autre site (curieusement).</em></p>
<p><span style="text-decoration: underline;">Ceci étant, ce que l&#8217;on souhaite faire ici est assez simple :<br />
</span>- Interdire tout par défaut (comme tout firewall décent)<br />
- Authoriser spécifiquement les connexions d&#8217;administration depuis  nos IP<br />
- Permettre d&#8217;accéder directement aux serveurs derrière également depuis nos IP</p>
<p style="text-align: justify">Attention, il existe de très nombreux tricks à mettre en place pour avoir le top du top, dans le /proc/sys/net/ipv4, afin d&#8217;ajouter des règles anti DOS,  d&#8217;ajuster la stack IP pour la gestion des connexions demi ouvertes, gérer la réduction des timeouts, et puis aussi par des règles pour loger les attaques, ajouter des systèmes de sondes/IDS etc&#8230;</p>
<p>C&#8217;est un firewall assez basique que je vais exposer ici. Pour de très fortes charges, il faudra également vérifier les capacités de NAT de la machine qui repose sur un système de buckets, lui même calculé en fonction de la RAM de la machine. Il faudra également redonder la machine, etc&#8230; <em>(Mais avant que vous en soyez là, vous pourrez largement vous payer les services de personnes qui voient très bien de quoi je parles)<br />
</em></p>
<p><span style="text-decoration: underline;">Préparation du Kernel :</span></p>
<ol>
<li>On télécharge les patchs de GRSEC <a title="GRSEC patch" href="http://www.grsecurity.net/grsecurity-2.1.12-2.6.27.10-200812271347.patch.gz" target="_blank">ici</a>,<a title="GRadmin" href="gradm-2.1.12-200812271437.tar.gz"> ici</a> (et en option le patch pour iptables <a title="GRSEC patch iptables" href="http://www.grsecurity.net/grsecurity-iptables-1.4.0.patch">ici</a>)</li>
<li>On télécharge le kernel qui va avec la version de grsec <a title="Kernel 2.6.27.10" href="http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.27.10.bz2">ici</a></li>
<li>On détar/dézip les archives et on applique les patchs (<strong>bzip2 -d kernel*; tar xvf grsec*;patch -p0 &lt; gr*.patch</strong>)</li>
<li>On ajoute deux ou trois tools qui risque de manquer : <strong>install libncurses-dev ncurses-dev make gcc paxtest gradm2 chpax</strong></li>
<li>On configure le kernel (make menuconfig), voici l&#8217;ultra minimum :<br />
- Pas de support des modules, tout en statique (ca évite l&#8217;insertion de backdoor)<br />
- networking/networking options/netfilter/ip:netfilter configuration/activer la majorité des options<br />
- Security options / Grsec: activez tout sauf dans kernel auditing juste les relocations et forks, dans Pax mettez tout.</li>
</ol>
<p style="text-align: justify">C&#8217;est une config <u>ultra</u> minimaliste. Pour plus d&#8217;info de nombreux sites parle de la compilation du noyau, le <a title="howto iptables" href="http://www.nbs-system.com/dossiers/howto-iptables.html" target="_blank">howto iptables</a> est un peu plus précis aussi mais c&#8217;est trop long à expliquer pour avoir une place ici. Après, de nombreuses petites ou grands optimisations peuvent être effectuées au niveau du noyau, les  résultats, du coté performances, comme du coté sécurité s&#8217;en ressentiront. Disons que si vous avez correctement configuré votre kernel avec pax et grsec, normalement les autres options par défaut sont rarement débiles.</p>
<p><span style="text-decoration: underline;">Pour le firewall à proprement parler, on va faire simple dans un premier temps :</span></p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p656code2'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6562"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
</pre></td><td class="code" id="p656code2"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># short, simple, incomplete, not really commented iptables script for Debianed firewalls/rproxy/load balancers by Philippe Humeau (c) 2009 NBS System, lord Rusty forgive me, amen</span>
&nbsp;
<span style="color: #007800;">IPTABLES</span>=<span style="color: #ff0000;">&quot;/sbin/iptables&quot;</span> 
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
start<span style="color: #7a0874; font-weight: bold;">&#41;</span> 
&nbsp;
<span style="color: #007800;">date</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">'%b %d %k:%M:%S'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">ADMIN_IP</span>=<span style="color: #ff0000;">&quot;88.77.111.222&quot;</span> <span style="color: #666666; font-style: italic;"># &amp;lt;-------------- Change me !</span>
<span style="color: #007800;">SERVERS_IP</span>=<span style="color: #ff0000;">&quot;192.168.1.0/24&quot;</span>
<span style="color: #007800;">SERVERS_WEB1</span>=<span style="color: #ff0000;">&quot;192.168.1.2&quot;</span>
<span style="color: #007800;">SERVERS_WEB2</span>=<span style="color: #ff0000;">&quot;192.168.1.3&quot;</span>
<span style="color: #007800;">SERVERS_DB</span>=<span style="color: #ff0000;">&quot;192.168.1.4&quot;</span>
<span style="color: #007800;">INET</span>=<span style="color: #ff0000;">&quot;eth0&quot;</span>
<span style="color: #007800;">SERVERS</span>=<span style="color: #ff0000;">&quot;eth1&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$date</span> -- Starting Firewall --&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>kern.log
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;-&amp;gt; \033[40m\033[1;31mSetting Default Policies to DROP \033[0m &amp;lt;-&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-P</span> INPUT DROP
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-P</span> OUTPUT DROP
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-P</span> FORWARD DROP 
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;-&amp;gt; \033[40m\033[1;33mFlushing all rules &amp;amp; tables \033[0m &amp;lt;-&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-F</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-X</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-Z</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-F</span> INPUT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-F</span> OUTPUT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-F</span> FORWARD
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-F</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-Z</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-X</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-N</span> LOG_DROP
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> LOG_DROP <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>h <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-j</span> LOG <span style="color: #660033;">--log-tcp-options</span> <span style="color: #660033;">--log-prefix</span> <span style="color: #ff0000;">'Dropped: '</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> LOG_DROP <span style="color: #660033;">-j</span> DROP
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-N</span> syn-flood
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> syn-flood <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">10</span><span style="color: #000000; font-weight: bold;">/</span>s <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">10</span> <span style="color: #660033;">-j</span> RETURN
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> syn-flood <span style="color: #660033;">-j</span> DROP 
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;-&amp;gt; \033[40m\033[1;34m Set kernel networking tweaks \033[0m &amp;lt;-&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>ip_forward
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>ip_dynaddr
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>all<span style="color: #000000; font-weight: bold;">/</span>accept_source_route
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>tcp_timestamps
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>tcp_syncookies
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>all<span style="color: #000000; font-weight: bold;">/</span>accept_redirects
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">2</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>all<span style="color: #000000; font-weight: bold;">/</span>rp_filter
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>icmp_ignore_bogus_error_responses
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">16384</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>ip_conntrack_max
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>all<span style="color: #000000; font-weight: bold;">/</span>log_martians
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">30</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>tcp_fin_timeout
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">2400</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>tcp_keepalive_time
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>kernel<span style="color: #000000; font-weight: bold;">/</span>printk
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1800</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>tcp_keepalive_time
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>tcp_window_scaling
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>tcp_sack
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">64</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>ip_default_ttl
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">2048</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>ip_queue_maxlen
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>icmp_ignore_bogus_error_responses
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>icmp_echo_ignore_broadcasts
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>tcp_ecn
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;-&amp;gt; \033[40m\033[1;33m INPUT RULING \033[0m &amp;lt;-&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> all <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> ESTABLISHED,RELATED <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$ADMIN_IP</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> <span style="color: #007800;">$SERVERS</span> <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">11211</span> <span style="color: #660033;">-j</span> ACCEPT <span style="color: #666666; font-style: italic;"># memcached</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> <span style="color: #007800;">$SERVERS</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$SERVERS_IP</span> <span style="color: #660033;">-j</span> ACCEPT        <span style="color: #666666; font-style: italic;"># accept très (trop) générique pour les requêtes des serveurs au rp/lb/fw</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> ICMP <span style="color: #660033;">-i</span> SERVERS <span style="color: #660033;">-s</span> <span style="color: #007800;">$SERVERS_IP</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> ICMP <span style="color: #660033;">-i</span> lo <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$SERVERS_IP</span> <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span>m <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #666666; font-style: italic;"># &quot;Spoofed packet: &quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-f</span> <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span>m <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #666666; font-style: italic;"># &quot;Frag packet: &quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-p</span> icmp <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">12</span><span style="color: #000000; font-weight: bold;">/</span>hour <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-j</span> LOG <span style="color: #660033;">--log-prefix</span> <span style="color: #ff0000;">&quot;ICMP: &quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">22</span> <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span>m <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #666666; font-style: italic;"># &quot;SSH loggin attempt&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--tcp-flags</span> ALL FIN,URG,PSH <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span>m <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">5</span> <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #666666; font-style: italic;"># &quot;Stealth XMAS scan&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--tcp-flags</span> ALL SYN,RST,ACK,FIN,URG <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span>m <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">5</span> <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #660033;">--log-prefix</span> <span style="color: #ff0000;">&quot;Stealth XMAS-PSH scan&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--tcp-flags</span> ALL ALL <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span>m <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">5</span> <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #666666; font-style: italic;"># &quot;Stealth XMAS-ALL scan&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--tcp-flags</span> ALL FIN <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span>m <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">5</span> <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #666666; font-style: italic;"># &quot;Stealth FIN scan&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--tcp-flags</span> SYN,RST SYN,RST <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span>m <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">5</span> <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #666666; font-style: italic;"># &quot;Stealth SYN/RST scan&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--tcp-flags</span> SYN,FIN SYN,FIN <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span>m <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">5</span> <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #666666; font-style: italic;"># &quot;Stealth SYN/FIN scan(?)&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--tcp-flags</span> ALL NONE <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span>m <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">5</span> <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #666666; font-style: italic;"># &quot;Stealth Null scan&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--dport</span> <span style="color: #000000;">0</span> <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>h <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #666666; font-style: italic;"># &quot;Port 0 OS fingerprint&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> udp <span style="color: #660033;">--dport</span> <span style="color: #000000;">0</span> <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>h <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #666666; font-style: italic;"># &quot;UDP port 0 OS fingerprint&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--sport</span> <span style="color: #000000;">0</span> <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>h <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">5</span> <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #666666; font-style: italic;"># &quot;TCP source port 0&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> udp <span style="color: #660033;">--sport</span> <span style="color: #000000;">0</span> <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>h <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">5</span> <span style="color: #660033;">-j</span> LOG_DRop <span style="color: #666666; font-style: italic;"># &quot;UDP source port 0&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> multiport <span style="color: #660033;">--sports</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">21</span>,<span style="color: #000000;">22</span>,<span style="color: #000000;">23</span>,<span style="color: #000000;">80</span>,<span style="color: #000000;">110</span>,<span style="color: #000000;">143</span>,<span style="color: #000000;">443</span>,<span style="color: #000000;">993</span>,<span style="color: #000000;">995</span> <span style="color: #660033;">-m</span> limit <span style="color: #660033;">--limit</span> <span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>h <span style="color: #660033;">--limit-burst</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-j</span> LOG_DROP <span style="color: #666666; font-style: italic;"># &quot;Napta/smurfing/Drd/Dos&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-p</span> tcp <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">--syn</span> <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> DROP <span style="color: #666666; font-style: italic;"># &quot;drop TCP connexion wich doesn't start by a syn&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> INVALID <span style="color: #660033;">-j</span> DROP
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> INPUT <span style="color: #660033;">-i</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--syn</span> <span style="color: #660033;">-j</span> syn-flood 
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;-&amp;gt; \033[40m\033[1;32m FORWARD RULING \033[0m &amp;lt;-&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> INVALID <span style="color: #660033;">-j</span> DROP
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-p</span> all <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> ESTABLISHED,RELATED <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-i</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-o</span> <span style="color: #007800;">$SERVERS</span> <span style="color: #660033;">--dport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-i</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-o</span> <span style="color: #007800;">$SERVERS</span> <span style="color: #660033;">--dport</span> <span style="color: #000000;">443</span> <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-o</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$SERVERS</span> <span style="color: #660033;">--dport</span> <span style="color: #000000;">20</span> <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-o</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$SERVERS</span> <span style="color: #660033;">--dport</span> <span style="color: #000000;">21</span> <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-o</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$SERVERS</span> <span style="color: #660033;">--dport</span> <span style="color: #000000;">22</span> <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-o</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$SERVERS</span> <span style="color: #660033;">--dport</span> <span style="color: #000000;">25</span> <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-o</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$SERVERS</span> <span style="color: #660033;">--dport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> FORWARD <span style="color: #660033;">-o</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$SERVERS</span> <span style="color: #660033;">--dport</span> <span style="color: #000000;">443</span> <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> NEW <span style="color: #660033;">-j</span> ACCEPT 
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;-&amp;gt; \033[40m\033[1;32m OUTPUT RULING \033[0m &amp;lt;-&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-p</span> all <span style="color: #660033;">-m</span> state <span style="color: #660033;">--state</span> ESTABLISHED,RELATED <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-p</span> ICMP <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-p</span> TCP <span style="color: #660033;">--dport</span> <span style="color: #000000;">20</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-p</span> TCP <span style="color: #660033;">--dport</span> <span style="color: #000000;">21</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-p</span> TCP <span style="color: #660033;">--dport</span> <span style="color: #000000;">22</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-p</span> TCP <span style="color: #660033;">--dport</span> <span style="color: #000000;">25</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-p</span> UDP <span style="color: #660033;">--dport</span> <span style="color: #000000;">53</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-p</span> TCP <span style="color: #660033;">--dport</span> <span style="color: #000000;">80</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-p</span> UDP <span style="color: #660033;">--dport</span> <span style="color: #000000;">123</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-p</span> TCP <span style="color: #660033;">--dport</span> <span style="color: #000000;">123</span> <span style="color: #660033;">-j</span> ACCEPT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-A</span> OUTPUT <span style="color: #660033;">-p</span> TCP <span style="color: #660033;">--dport</span> <span style="color: #000000;">443</span> <span style="color: #660033;">-j</span> ACCEPT
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;-&amp;gt; \033[40m\033[1;33m Masquerading \033[0m &amp;lt;-&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-A</span> POSTROUTING <span style="color: #660033;">-p</span> tcp <span style="color: #660033;">--tcp-flags</span> SYN,RST SYN <span style="color: #660033;">-j</span> TCPMSS <span style="color: #660033;">--clamp-mss-to-pmtu</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-A</span> POSTROUTING <span style="color: #660033;">-i</span> <span style="color: #660033;">-o</span> <span style="color: #007800;">$INET</span> <span style="color: #660033;">-j</span> MASQUERADE
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;-&amp;gt; \033[40m\033[1;32m Firewall Setup complete, activating Forward \033[0m &amp;lt;-&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>ip_forward 
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;------------------------&amp;gt; \033[40m\033[1;32mEOF : End of Firewall \033[0m&amp;lt;-----------------------&quot;</span>
<span style="color: #000000; font-weight: bold;">;;</span> 
&nbsp;
stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;\033[40m\033[1;31m----------------------&amp;gt; Shutting down Firewall ! &amp;lt;----------------------\033[0m&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; &quot;</span>
<span style="color: #007800;">IPTABLES</span>=<span style="color: #ff0000;">&quot;/sbin/iptables&quot;</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-F</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-X</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-Z</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-F</span> INPUT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-F</span> OUTPUT
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-F</span> FORWARD
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-F</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-Z</span>
<span style="color: #007800;">$IPTABLES</span> <span style="color: #660033;">-t</span> nat <span style="color: #660033;">-X</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>ipv4<span style="color: #000000; font-weight: bold;">/</span>ip_forward
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;-&amp;gt; DONE ! &amp;lt;-&quot;</span>
<span style="color: #000000; font-weight: bold;">;;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: /etc/init.d/firewall {start|stop}&quot;</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">;;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">esac</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p><BR></p>
<p style="text-align: justify"><span style="text-decoration: underline;">Quelques points :<br />
</span>- N&#8217;oubliez pas de durcir tous vos noyaux de serveurs, tout spécialement celui-ci, avec le patch GRSEC pour le kernel Linux. (ca doit aussi être décrit dans le howto de mémoire).</p>
<p style="text-align: justify;">- Si on veut être plus méchant, au lieu de DROP on peut utiliser TARPIT si on a compilé iptables avec, ca fait un bel effet sur la machine attaquante !</p>
<p style="text-align: justify;">- Si le scipt ne charge pas c&#8217;est que j&#8217;ai fais un faute de frappe quelque part, corrigez là <img src='http://www.wikigento.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Si il ne charge pas parcequ&#8217;il manque des target, ajoutez les dans le noyau au moment de sa compilation.</p>
<h1>Le Reverse Proxy</h1>
<p><BR></p>
<h2>Introduction</h2>
<p style="text-align: justify">
<p style="text-align: justify">Le Firewall est une fonction en soit est très peu consommatrice car, sur un noyau linux, c&#8217;est embarqué. Netfilter et son application de pilotage iptables  sont des outils très puissants et très économes.</p>
<p style="text-align: justify">Dans le cas qui nous préoccupe, c&#8217;est d&#8217;autant plus vrai qu&#8217;on va filtrer très peu de chose, ce n&#8217;est pas non plus le firewall du pentagone, on va juste protéger les accès d&#8217;administration. Sur notre beau serveur, on a dépensé 0,000001% de la capacité CPU, que faire du reste ?</p>
<p style="text-align: justify">Hummmmm du folding@home, du calcul de Pi, un serveur Quake 3, du Seti project : non !</p>
<p>On va faire un reverse proxy et un load balancer qui eux peuvent commencer à occuper un peu la machine sur ses 99,999999 % de temps CPU restant.</p>
<p style="text-align: justify;">Le reverse proxy, c&#8217;est une histoire un peu plus complexe. Si on part sur une solution simple, Squid est très capable. Pour de la dentelle, qui nécessite aussi une optimisation du code pour en tirer le plein partit, Varnish est une solution plus costaud mais réellement plus longue à mettre en place. On va donc ici s&#8217;atteler à concevoir un Squid correcte.</p>
<h2>Rôle<span style="text-decoration: underline;"><br />
</span></h2>
<p><span style="text-decoration: underline;">Le rôle du reverse proxy c&#8217;est ca :</span><br />
<a rel="attachment wp-att-681" href="http://www.wikigento.com/?attachment_id=681"><img class="alignnone size-full wp-image-681" title="rp stats" src="http://www.wikigento.com/wp-content/uploads/2009/04/rp.jpg" alt="rp stats" width="394" height="358" /></a></p>
<p>Réduire les accès aux serveurs Web en les allégeants de tout ce qui n&#8217;a pas de valeur ajouté, tout ce qui n&#8217;est pas généré.  J&#8217;ai pris volontairement une page très lourde pour la démonstration.</p>
<p><span style="text-decoration: underline;">En l&#8217;occurence on va cacher :</span></p>
<ul>
<li>Le HTML</li>
<li>Les CSS</li>
<li>Les images</li>
<li>Les fichiers Javascript</li>
</ul>
<p style="text-align: justify">et forcément, le serveur Web, ca lui fait du bien. En résumé, il se concentre sur les requêtes Ajax et le PHP, il laisse les transferts &laquo;&nbsp;de base&nbsp;&raquo; au Rproxy. Evidemment, un tour de magie de ce type, ca consomme un maximum en RAM car il faut tout stocker en RAM pour aller vite. Si on doit charger chaque éléments depuis le disque dur, c&#8217;est plutôt lent. Un bon reverse proxy a donc beaucoup de RAM et un processeur correct, sans plus puisque la charge processeur est faible.</p>
<p style="text-align: justify">Au final, même si l&#8217;exemple ici, un peu exagéré, montre un gain de 97%, on gagne quand même en général au minimum 75% de trafic en moins vers le ou les serveurs Web. Donc qu&#8217;on ait un serveur Web ou plusieurs, le reverse proxy est <span style="text-decoration: underline;">in-dis-pen-sable</span>.</p>
<p style="text-align: justify;">Une autre optimisation intelligente sur ce point est à faire au niveau du code. Un fichier JS, un fichier CSS et pas des millions, ca change des choses. Du coup, concaténer tout cela intelligemment, c&#8217;est un plus non négligeable. Un gars s&#8217;est pris la tête à faire le boulot pour vous et encore mieux, il en a fait un plugin Magento, que demande le peuple ? Au fait ca s&#8217;appel <a title="Fooman speedster Module" href="http://www.magentocommerce.com/extension/457/fooman-speedster" target="_blank">Fooman speedster module</a> et, depuis l&#8217;invention de la fénéantise, c&#8217;est un des outils les plus indispensable pour optimiser sans se fatiguer.</p>
<h2>Installation de Squid</h2>
<p style="text-align: justify">
Vous êtes des gens biens, vous avez une Debian.</p>
<p>Vous pouvez aussi être des gens bien et ne pas avoir de Debian mais dans ce cas vous savez installer une tarball ou un package. Il y a même des gens bien qui travaillent avec OpenBSD par exemple, ils ont toute ma considération mais je ne ferai pas de howto pour <img src='http://www.wikigento.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  (Il n&#8217;y a plus de gens bien sous HPUX rassurez moi ?)</p>
<p>Le coté &laquo;&nbsp;à la main&nbsp;&raquo;, je sais faire aussi mais, personnellement, j&#8217;adore APT et DPKG <img src='http://www.wikigento.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="text-decoration: underline;">Attention, on se concentre, installer Squid ce n&#8217;est pas simple sous debian :</span></p>
<p>~&gt; su   (on passe root car on est <span style="text-decoration: underline;">jamais</span> loggé en root par défaut)<br />
~&gt; apt-get install squid</p>
<p>Ok on respire, on a fait le plus dur. Un petit café pour se récompenser s&#8217;impose, bravo, vous avez bien bossé ! (merci aux gars de Gnu aussi). Ca c&#8217;est fait, Squid est installé, on souffle, on respire, c&#8217;était dur mais la vie est dure parfois.</p>
<h2>Configuration de squid en reverse proxy Magento</h2>
<p style="text-align: justify;">Phase 2, on essaye de faire croire aux patrons qu&#8217;on est payé à faire quelque chose de balaise et incompréhensible, qui mérite probablement une augmentation énorme mais qu&#8217;on va se contenter de 10% et une voiture de fonction : on édite le fichier de configuration.</p>
<p style="text-align: justify;">Bon Squid c&#8217;est un proxy et un reverse proxy. En gros ca permet dans un cas comme dans l&#8217;autre de gérer un cache pour que les fichiers régulièrement demandés soient dans un cache rapide, mémoire de préférence, plutot que redemandés voir ré interprétés par le serveurs Web. Ca allège énormément les serveurs dans le cas du reverse proxy. Le proxy cache les réponses des serveurs Web aux browsers http pour les acheminer au client sans les redemander. Le reverse proxy lui fait l&#8217;inverse (d&#8217;où le reverse), il stocke les réponses les plus souvent envoyées par le serveurs aux clients afin de servir ceux-ci sans demander quoique ce soit aux serveurs Web.</p>
<p style="text-align: justify;">Bref Squid c&#8217;est complexe, énorme, un fichier de conf de base ca fait dans les 7000 lignes avec les commentaires, je vous livre donc ici une version expurgée des commentaires, juste préparer pour du reverse proxy et dont toutes les fonctions ne sont pas activées, juste les principales. Encore une précision, quand vous utilisez un reverse proxy, n&#8217;oubliez pas que votre serveur Web ne verra plus toutes les requêtes&#8230; Eh oui, c&#8217;est bien le but d&#8217;ailleurs. Donc ce qui est intercepté doit être minutieusement loggé pour pouvoir avoir des stats et compléter celles des serveurs Web sous Apache.</p>
<p><span style="text-decoration: underline;">Allez, voici la configuration :</span></p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p656code3'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6563"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
</pre></td><td class="code" id="p656code3"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Squid sooooo basic configuration for Magento, by Philippe Humeau &amp;amp; Adrien Urban (c) 2009 NBS System</span>
acl manager proto cache_object
acl localhost src 127.0.0.1<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">32</span>
acl to_localhost dst 127.0.0.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">8</span>
acl SSL_ports port <span style="color: #000000;">443</span>
acl Safe_ports port <span style="color: #000000;">80</span>		<span style="color: #666666; font-style: italic;"># http</span>
acl Safe_ports port <span style="color: #000000;">443</span>		<span style="color: #666666; font-style: italic;"># https</span>
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny <span style="color: #000000; font-weight: bold;">!</span>Safe_ports
http_access deny CONNECT <span style="color: #000000; font-weight: bold;">!</span>SSL_ports
icp_access deny all
htcp_access deny all
&nbsp;
http_port 192.168.1.1:<span style="color: #000000;">80</span> transparent <span style="color: #007800;">name</span>=proxy_int_IP
http_port 33.44.55.66:<span style="color: #000000;">80</span> transparent <span style="color: #007800;">name</span>=ip_demostore
hierarchy_stoplist cgi-bin ?
&nbsp;
cache_mem <span style="color: #000000;">6144</span> MB
maximum_object_size_in_memory <span style="color: #000000;">8</span> MB
memory_replacement_policy heap lfuda
cache_dir null <span style="color: #000000; font-weight: bold;">/</span>tmp
&nbsp;
&nbsp;
access_log <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>squid3<span style="color: #000000; font-weight: bold;">/</span>access.log squid
access_log <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>squid3<span style="color: #000000; font-weight: bold;">/</span>access-apache.log combined
refresh_pattern <span style="color: #7a0874; font-weight: bold;">&#40;</span>cgi-bin<span style="color: #000000; font-weight: bold;">|</span>\?<span style="color: #7a0874; font-weight: bold;">&#41;</span>	<span style="color: #000000;">0</span>	<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span>	<span style="color: #000000;">0</span>
refresh_pattern .		<span style="color: #000000;">0</span>	<span style="color: #000000;">20</span><span style="color: #000000; font-weight: bold;">%</span>	<span style="color: #000000;">4320</span>
icp_port <span style="color: #000000;">3130</span>
&nbsp;
acl localhost src 127.0.0.1<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">8</span>
acl localnet src 192.168.1.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span>
&nbsp;
acl debianUpdate dstdomain ftp.fr.debian.org              <span style="color: #666666; font-style: italic;"># pour les updates Debian</span>
acl debianUpdate dstdomain security.debian.org          <span style="color: #666666; font-style: italic;"># pour les updates Debian</span>
acl dstOutAllowed dstdomain ws.mperf.com                <span style="color: #666666; font-style: italic;"># pour le mailing, remplacer mailperf par votre fournisseur</span>
acl dstOutAllowed dstdomain chart.apis.google.com      <span style="color: #666666; font-style: italic;"># pour les beaux graphs à la google style</span>
acl dstOutAllowed dstdomain www.magentocommerce.com     <span style="color: #666666; font-style: italic;"># devinez</span>
acl dstOutAllowed dstdomain connect.magentocommerce.com <span style="color: #666666; font-style: italic;"># devinez v2.0</span>
acl dstOutAllowed dstdomain pear.php.net                           <span style="color: #666666; font-style: italic;"># devinez v3.0</span>
acl dstOutAllowed dstdomain schemas.xmlsoap.org                <span style="color: #666666; font-style: italic;"># pour les wsdl, soaperie et autres webservices</span>
&nbsp;
http_access allow localnet debianUpdate
http_access allow localnet dstOutAllowed
&nbsp;
acl IpInternal myportname proxy_int_IP
acl IpExternal myportname ip_demostore
acl dstdemostore dstdomain www.demostore.fr
acl dstdemostore dstdomain demostore.fr
never_direct allow dstdemostore
&nbsp;
<span style="color: #666666; font-style: italic;"># demostore</span>
cache_peer 192.168.1.2 parent <span style="color: #000000;">80</span> <span style="color: #000000;">0</span> no-query round-robin sourcehash
cache_peer 192.168.1.3 parent <span style="color: #000000;">80</span> <span style="color: #000000;">0</span> no-query round-robin sourcehash
cache_peer_access 192.168.1.2 allow dstdemostore
cache_peer_access 192.168.1.3 allow dstdemostore
&nbsp;
cache_peer_access 192.168.1.2 deny all
cache_peer_access 192.168.1.3 deny all
&nbsp;
http_access allow dstdemostore
&nbsp;
http_access deny all
&nbsp;
access_log <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>squid3<span style="color: #000000; font-weight: bold;">/</span>demostore-squid.log squid demostore
access_log <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>squid3<span style="color: #000000; font-weight: bold;">/</span>demostore-apache.log combined demostore</pre></td></tr></table></div>

<p style="text-align: justify">Dans cet exemple, votre serveur dispose de 8 Go de Ram et on en prend 6 pour le cache de squid. C&#8217;est évidemment à ajuster en fonction de votre configuration. (cache_mem 6144 MB) On a aussi une taille maximal de fichier à 8 Mo pour cacher les gros objets et on interdit le cache sur disque pour ne pas gréver les performances. On a paramétré le service Squid pour gérer www.demostore.fr et demostore.fr et donné l&#8217;accès aux serveurs vers d&#8217;autres hosts comme Magento connect ou les updates de Debian.</p>
<h2>Le load balancer</h2>
<p style="text-align: justify">Bonne nouvelle : c&#8217;est déjà fait !</p>
<p>Eh oui en donnant deux peers vous avez dit à Squid qu&#8217;il avait deux serveurs Web dont il devait s&#8217;occuper. Vous pourriez vouloir donner un poids différent (ici dans l&#8217;exemple c&#8217;est du 50/50) si vous avez des serveurs de puissance différentes. Il faudra alors ajouter Weight comme directive dans la déclaration des peers.</p>
<p>Le piège serait de faire du load balancing IP. Netfilter sait le faire, c&#8217;est même assez simple à mettre en oeuvre et pour tout vous dire c&#8217;est ce qu&#8217;on faisait à NBS System avant. Mais cela posait des problèmes quand le client arrivait d&#8217;une IP qui changeait en cour de session (gros firewall corporate qui nat par une autre connexion ou même simplement une adsl en ip variable). Du coup il vaut mieux passer par cette solution qui est plus propre.</p>
<h1>Memcached</h1>
<p><BR></p>
<h2>Introduction</h2>
<p style="text-align: justify">Nous y voila, la fin de l&#8217;aventure Firewall / Load Balancer / Reverse Proxy est proche&#8230;</p>
<p>Si je finis par ce point c&#8217;est aussi parce que c&#8217;est le plus facile quelque part.</p>
<p>On peut mettre memcached un peu partout dans l&#8217;infrastructure, sur le proxy, sur les serveurs Web ou même sur les serveurs de base de données. L&#8217;idée c&#8217;est de garder les sessions des surfers non pas en fichiers mais en mémoire. D&#8217;un point de vue performance, c&#8217;est très préférable et c&#8217;est simple à réaliser alors pourquoi s&#8217;en passer&#8230;</p>
<h2>Installation</h2>
<p style="text-align: justify">
On peut le mettre dans plusieurs endroit ce fameux memcached mais je préconise un serveur qui est unique et accédé / accessible par tous comme la base de données (si on a qu&#8217;un serveur de DB) ou le reverse proxy mais, si possible, pas sur les serveurs Web. En effet si l&#8217;un tombe, autant que l&#8217;autre puisse bosser et reprendre ses sessions. Evidemment, il vaut mieux que le dit serveur soit redondant ou bien costaud pour ne pas tomber sinon c&#8217;est toutes les sessions qu&#8217;on perd mais vu que le site tombera avec, ca sera un moindre problème <img src='http://www.wikigento.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
</p>
<p><u>Oui, je sais, toujours un peu douleureuse cette phase sous Debian : </u><br />
~&gt; su   (on passe root car on est <span style="text-decoration: underline;">plus</span> loggé en root, normal)<br />
~&gt; apt-get install memcached php5-memcached</p>
<p>Allez, ca va aller, c&#8217;est finit&#8230; On respire lentement, le rythme cardiaque redescend !</p>
<h2>Configuration</h2>
<p>Dans le fichier local.xml de Magento, vous devriez pouvoir ajouter :</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p656code4'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6564"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code" id="p656code4"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;global<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cache<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;backend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>memcached<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/backend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;memcached<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;compression</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cache_dir</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hashed_directory_level</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hashed_directory_umask</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;file_name_prefix</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;host<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>192.168.1.1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/host<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;port<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>11211<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/port<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;persistent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/persistent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/memcached<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/cache<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;session_save<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[memcache]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/session_save<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;session_save_path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[tcp://192.168.1.1:11211?persistent=1]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/session_save_path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/global<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>On peut aussi mettre memcached en dehors de Magento et de sa configuration, tout simplement en installant le démon avec une configuration dans le /etc/memcached.conf :</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p656code5'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6565"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p656code5"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># memcached ultra simplistic config file by philippe Humeau (c) 2009 NBS System</span>
<span style="color: #660033;">-d</span>
logfile <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>memcached.log
<span style="color: #660033;">-m</span> <span style="color: #000000;">1024</span>
<span style="color: #660033;">-p</span> <span style="color: #000000;">11211</span> 
<span style="color: #660033;">-u</span> nobody
<span style="color: #660033;">-l</span> 192.168.1.1</pre></td></tr></table></div>

<p><BR></p>
<h1>Conclusion</h1>
<p><BR></p>
<ol>
<li>Vous méritez un café après tout ce travail</li>
<li>Je mérite un café après ce travail de rédaction</li>
<li>Il est incompréhensible que les producteurs de café soient pauvres</li>
<li>La personne qui monte un site Magento entièrement dédié au café, il va se faire du blé</li>
</ol>
<p style="text-align: justify">Oui&#8230; Je sais&#8230; J&#8217;ai toujours un petit soucis sur les conclusions mais bon, vous commencez à être habitués depuis le temps et puis je me soigne.</p>
<p>Prochain exercice de style, l&#8217;article 2/3 : Configuration d&#8217;un serveur Web pour Magento !</p>
<p style="text-align: justify">
PS : N&#8217;oubliez pas de vous inscrire pour Bargento 2, il reste encore quelques places et après on est complet, ce qui implique que même en arrivant à l&#8217;improviste sur place, on ne pourra pas vous faire rentrer pour rester dans les capacités d&#8217;accueil de la salle.</p>
<p>De plus, le papier sur Zend Application Server et les performances de Magento devrait apporter un jour nouveau et pas mal de complément sur ce mini tuto / howto.</p>
<p>Par manque de temps, je n&#8217;ai pas eu le temps de tout tester sur un serveur donc si il y a des boulettes dans les fichiers de configuration, n&#8217;hésitez pas à me les signaler, je modifierai l&#8217;article.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wikigento.com/optimisation-systeme-reseau/construire-son-infrastructure-magento-partie-13-firewall-rproxy-load-balancer/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

