L'architecture décentralisée

Posté par Cedric, le 27/04/2009 - Technologie

T_156c0713c4417db6e883f57a975e59acLorsqu'on réalise un projet web d'envergure, il convient de prendre en compte les éléments annexes au développement: le référencement naturel (c'est le cas pour de plus en plus de développeur), et, chose moins commune, le déploiement et l'évolutivité de l'hébergement.

Si vous êtes sur financement, cette question pourra être rapidement éludée en passant par des prestataires à obligation de résultats, qui se chargeront pour vous de monter la meilleure architecture possible, quel qu'en soit le prix.

En revanche si vous êtes en auto-financement, les solutions techniques vous permettant de construire une architecture évolutive à moindre coût vous intéresseront. A notre sens, il convient ainsi de canaliser les goulets d'étranglement du serveur (généralement, la RAM, le processeur, et les écritures simultanées sur le disque dur, hors swap) en séparant les tâches sur des serveurs différents, ce qui permet de monter des système extensibles et légers.

Ainsi, un site avec du PHP extensif, comme une application sous symfony sera réparti ainsi:

- Un serveur avec pas mal de RAM pour servir le frontend. Sur ce serveur, une partie de la RAM doit être allouée à un accélérateur d'opcode type APC (512 Mo dédié parait pas mal). Cela permet de garder en cache une version précompilée de vos fichiers PHP, très utile quand on utilise un framework, puisqu'un framework procède à des inclusions en série de milliers de fichiers PHP, ce qui créé une brèche de rapidité automatiquement.

- Un serveur avec pas mal de RAM/proc pour la base de données. Idéalement, cette base de données ne remplit qu'un seul des deux rôles clés: soit elle lit, soit elle écrit. Si elle écrit, elle doit être couplée à une base "esclave", elle même sur un serveur à part, avec encore moins de RAM. Si vous optez pour un tel système, sachez que cela implique pas mal de changement côté applicatif, puisque vous devez signaler à chaque action persistante la base de données à utiliser. Dans la théorie, des ORM avancés comme Doctrine et son fameux système de listeners permettent de faire cela. Dans la pratique, on a beaucoup de surprises.

- Un + qui fera toute la différence: si vous avez assez de RAM, et si vos serveurs de DB sont connectés à votre serveur de front en VLAN, profitez-en pour installer Memcache sur ce serveur, ouvrir le port adéquat, et stockez-y vos sessions utilisateurs. Memcache est infiniment plus rapide qu'un stockage sur disque dur, car les couples clés/valeurs sont stockés directement dans la mémoire vive.  Autre avantage, le fait d'avoir vos sessions stockées directement sur un serveur dédié à cette tâche rend votre serveur d'application encore plus indépendant, ce qui facilite, si besoin est, son extension par quelque méthode que ce soit (load balancing, failover heartbeat, round robin, etc...).

- Ensuite, nous vous recommandons de vous débarasser de la gestion des "assets" (éléments persistants uploadés par les administrateurs ou les utilisateurs, typiquement des images). En plus d'encombrer votre bande passante et de démultiplier vos lectures/écritures sur disque dur (ce qui augmente considérablement les risques de casse et pose le souci de la sauvegarde), vous rendez votre cluster de front plus difficile à mettre en place. En effet, pour que celui-ci soit efficace, il faut que chaque serveur contienne exactement la même chose. S'il existe des solutions de synchronisation comme rsync, ou mieux, unison, l'idéal est à notre sens de passer par un système de stockage tiers, comme Amazon S3 ou Mosso. Certes, l'implémentation côté applicatif sera plus complexe à gérer, mais vous vous débarrasserez des problèmes de sauvegarde, de sécurité, et surtout, vous allégerez considérablement votre/vos serveur(s)  applicatif(s).

- Pour finir, quelque chose de plus classique, débarrassez vous de la gestion des emails. Cela monopolise beaucoup de ressources (les AV et autres antispam sont TRES gourmands en RAM), et cela requiert énormément de maintenance pour conserver un système efficace. Optez pour une solution payante (vous transférez les MX et ne vous occupez plus de rien), ou optez au "pire" pour Google Apps qui vous permet également de faire ce genre de délocalisation, souvent pour le bonheur de vos utilisateurs.

Voilà, en ayant ce réflexe délocalisation, vous pouvez bâtir un serveur applicatif ultra light, extensible à l'infini, sécurisé à tous les niveaux (lancez un petit cron sur les serveurs de DB pour faire un dump et l'envoyer sur S3, ca prend 10 mn et 20mn pour faire le travail inverse), et très rapide à mettre en place. Côté installation, nous vous recommandons de travailler sur des box identiques, montées par exemple avec un Ubuntu LTS vide, et bloqués sur tous les ports qu'on utilisera pas avec iptable, ce qui rendra le tout encore plus sécurisé.

En conclusion, faire un système scalable, c'est également penser serveurs, et penser serveurs impose bien souvent de développer des spécificités au sein même de la couche applicative. Dans un prochain article, nous étudierons d'autres moyens d'accélérer l'exécution de son application.

tags: bootstrapping, linux, serveurs, symfony

A lire aussi: Comments Commentaires
Merci pour toutes ces petites astuces qu'on ne trouve que difficilement sous cette forme synthétisée.

J'attends le prochain article!

Posted by Loïc on 27/04/2009

Autant de conseils en 20 lignes: Merci !

Posted by Amine on 28/04/2009

Merci bien pour toutes ces précieuses informations.
Serait il possible dans un prochain billet de définir ce qui constitue "un projet web d'envergure", c'est à dire à partir de quand passer d'une installation monolithique à des serveurs délocalisés par fonction comme ce qui est décrit ici.
(Nombre de pages par seconde ou acivité CPU ou autre)
La debug toolbar de Symfony permet de déterminer si un composant de l'application prend relativement trop de temps, mais elle n'est pas utilisée en production.

Posted by JPhilip on 30/04/2009

Jean Philippe,

Pour moi, un projet web d'envergure est simplement un projet à fort trafic (à partir de 4 ou 5K UV / jour), et qui généralement fait tomber un serveur standard (SWAP, apache qui tombe, processeur en charge maximale, load average constamment > 1 ou +).

Attention cependant, un serveur qui sature ne veut pas forcément dire que le site croule sous les visiteurs. Cela peut également être lié à une très mauvaise conception et une sous-optimisation (ce qu'on retrouve souvent dans les projets qui utilisent des CMS comme Joomla, Drupal ou autres).

Plus d'articles sur les architectures serveurs et la sécurité prochainement.

Cedric

Posted by cedric on 04/05/2009

so it's unbelieveable what you're doing over here, thanks

Posted by resume writers on 16/04/2010

Dresses, evening, cocktail, prom dresses, formal gowns from eiDress. Homecoming dresses and bridesmaid.
discount Evening Dresses
Prom dresses, evening wear, daywear and accessories from celebrity designers and exclusive ranges. Buy online or visit our prom dresses stores
prom dresses
discount prom dresses
New Style Moncler,Moncler jackets,Moncler coats online
Moncler coats
Moncler
Moncler jackets,Moncler,Moncler coats,Moncler vest,discount Moncler outlet, moncler polot shirt Moncler Men Moncler Women Moncler Children Moncler Hats.
Moncler Jackets
UK Moncler

Posted by evening dresses on 17/06/2010

wedding dresses,wedding gowns,bride dresses,bridesmaids dresses,evening dresses,bridal gowns,
flower girl dresses.
Evening Dresses
wedding Dresses
discount wedding dresses
Prom Dresses: Find Online fashionable prom dresses,homecoming dresses from top USA prom gowns designers,
Evening dresses, sexy Tops , casual dress ,sexy
discoun prom prom dresses
Elegant couture designer evening gowns, sexy dresses, inexpensive on sale prom dresses,
discoun evening dresses
Nationwide bridal salon offers bridal and wedding gowns, bridesmaid dresses,
flower girl dresses, tuxedos, and other special occasion apparel. Site includes a bridal
links london
links of london
discoun prom dresses


Posted by xiaoxiao on 20/06/2010

If the coach handbags outlet is in bad shape, consider taking it to a professional. coach outlet store cobblers will usually do purse and bag restoration. You also can take coach wallets to small specialty mom-and-pop shops or online vendors like Lovin'

Posted by coach outlet stores on 25/06/2010

It looks good,I have learn a recruit!Recently,I found an excellent online store, the XX are completely various, good quality and cheap price,[url=http://www.nikemaxsale.com]nike air max shoes[/url] it’s worth buying!


Posted by nike air max on 07/07/2010

It looks good,I have learn a recruit!Recently,I found an excellent online store, the XX are completely various, good quality and cheap price,nike air max shoes it’s worth buying!

Posted by nike air max on 07/07/2010

The Lingerie Store,The lingerie and nightwear SALE at Style Lingerie. All lingerie sale garments marked 30% to 70% off. Sexy lingerie, ladies underwear and designer nightwear
lingerie store
lingerie sale
sexy lingerie
Sexy Clubwear
Sexy Sexy Lingerie is an online lingerie store selling designer lingerie including Shirley of Hollywood, Dreamgirl and Hustle
Sexy Costumes
sexy nurses costume
sexy Sports costume
Vinyl Lingerie
lingerie sale

Posted by lacewigs on 07/07/2010

thank you! I like this news, I also have information to share, here is my message.
mbt mbt mbt 靴 mbt 靴 mbtシューズ mbt シューズ

Posted by mbt on 08/07/2010

Buying an expensive juicy couture pants is big deal for just about anyone. However, if you don’t take care of your juicy couture hoodie , the results can be devastating. Stained fabric, water stains and dried out leather can ruin your juicy couture backpack. It’s important to take the proper steps to take care of your Juicy Couture handbag.

Posted by rayallen on 13/07/2010

It looks good,I have learn a recruit!Recently,I found an excellent online store, the XX are completely various, good quality and cheap price,nike air max shoes it’s worth buying!

Posted by nike air max on 15/07/2010

Almost all the ghd straighteners of all ages are proud of their straighteners hair.From the earliest women to the present GHD hair straighteners,women think that having that mass of hair straightners on their top is the best ghd cheap to have.Many women actually don’t want to go for short pink GHD for the fear that chi straightener are not going to look good.


But the chi hair straightener is that with proper styling,short chi hair dryer can look fabulous! Short cheap hair straighteners is easy to maintain and is healthier pink hair straighteners.There are a variety of short layered cheap straighteners with different styling best hair straightener that can make women look younger.The most popular short layered pink mk4 is the short layered bob.There are many ghd mk4 to it and using colors and highlights can accentuate the mk4 straighteners.

Posted by GHD straighteners on 22/07/2010

nfl jerseys have mentioned this before,but cheap nfl jerseys are going to say wholesale nfl jerseys again.Lately,everything Football Jerseys do turns into keyword research.NBA Jerseys love writing and MLB Jerseys have figured out a way to monetize nfl jerseys cheap - I've found something saints jerseys love and I'm getting paid for doing new orleans saints jerseys. If you're interested in another new orleans jerseys to create an income,check out my make drew brees jerseys HubPages and the of course join cheap saints jerseys.Anyway, back in January '08 when dallas cowboys jerseys joined HubPages I was out on maternity dallas cowboys jersey.Unfortunately,at that time,vikings jerseys were not eligible for the buffalo bills jerseys safety net of the miami dolphins jerseys by my employer or jets jersey by the state of New jets jerseys cheap.Now,in 2010,after pittsburgh steelers jerseys had that debilitating accident a few steeler jerseys years ago a new law has been passed and indianapolis colts jerseys many fall under it - the peyton manning jerseys.New Jersey is one of the first three new york giants jerseys to put this type of law into effect.

Posted by NFL jerseys on 22/07/2010

Now mbt shoes will state that these MBT shoes sale are not everyday walking skechers shoes.I would never reccommend going to work in discount mbt shoes within the first few months.The mbt shoes cheap is to start slow.5- 10 minutes a skechers shape up for the first three days,then increase at a comfortable Discount MBT.


They are designed to give your MBT Chapa the motion of walking on MBT Changa,a movement that requires the MBT Tataga of almost every muscle from your MBT Fora to your neck,forcing you to continually readjust your MBT Fanaka to gain its center of MBT Kaya.Take a look at people who walk at least 30 MBT Tunisha a day. Those who walk on the MBT Tembea become toned fasted than those who walk on flat,solid MBT VOI.

Posted by MBT shoes on 22/07/2010

ugg boots can save huge amounts of money by buying your ugg on sale online.It is always cheaper to buy from the UGG Bailey Button,rather than to buy from well known shopping tall ugg boots.The reason for is that the well known shopping discount ugg boots have to pay extra bills that an online ugg boots uk would not have to pay.For example,cheap ugg boots,electricity,heating, rent bills etc.Some UGG Classic Tall Boots might think that perhaps the shopping UGG Classic Cardy Boots would surely buy in bigger ugg cardy so can therefore sell the classic cardy boots at a cheaper price - however this is not always the classic cardy grey.More and more ugg classic tall are using the classic tall chestnut on a daily basis to do their bailey button boots,and therefore the orders going through the ugg button bailey for items such as ugg button and fashion are shooting up every ugg classic short.The shops that have been dominant for so many womens ugg boots are now starting to realise that in order to keep up with the online companies.

Posted by UGG boots on 22/07/2010

Cosplay Costumes Cosplay Wigs Movie TV Cosplay School Uniform Uniform Cosplay Cosplay Accessories .
cosplay costumes
cosplay
sexy lingerie
The Lingerie Store,The lingerie and nightwear SALE at Style Lingerie. All lingerie sale garments marked 30% to 70% off.
Sexy lingerie, ladies underwear and designer nightwear
lingerie store
lingerie sale
sexy lingerie
Sexy Clubwear
Lingerie, sleepwear and intimate apparel is our specialty, ranging from sexy lingerie to bridal lingerie,
including corset, bras, thongs and stockings.
Sexy Costumes
sexy nurses costume
sexy Sports costume
Vinyl Lingerie
lingerie sale

Posted by cosplay on 30/07/2010

supply in stock and custom lace front wigs, full lace wigs, lace wigs, human hair wigs,
remy lace front wigs, cheap wigs, cheap, buy, celebrity
full lace wigs
lace wigs
lace wigs sale
lace front wigs
synthetic front lace wigs
A Famous Dresses Shop which sell directly Wedding Dresses, Evening Dress, Bridesmaid Dresses,Prom dresses
cheap wedding dresses
cheap evening dresses
cheap prom dresses
cheap evening dresses
cheap prom dresses
Elegant evening dresses are always associated with the brides and their bridesmaids.Shopping for evening dresses and your wedding dress in stylish bridal ..

Posted by fiwedding on 05/08/2010

An online shop specializing in Herve Leger, Herve Leger Dress, Herve Leger Skirt,
Herve Leger
Shop the latest styles juicy couture handbags, juicy couture tracksuit.
Juicy Couture
FashionStyleOnsale offer high quality Moncler Jackets at low price.
Moncler Jackets on sale, shop more discount Moncler Vest, Moncler Coats at FashionStyleOnsale
Moncler

Posted by moncler on 11/08/2010

fashion Links of London From links of london earrings England international links of london watches fashion luxury Links of Londonbrand new star Links London Creative links of london Accessories inspiration from stylist links of london Rings to different countries are links of london Silver Chain designed to swim brigadelinks of london charms are supplied at Links of London our online store. links of london earrings are made of stering links of london Sweetie Bracelets silver and produced by qualified. links of london watches has promoted Links London the creation of the Links London design watches

Posted by chenjing123 on 22/08/2010

Experience Links of London is the aim Links London is to ascend to Links London wholesale a brand-new links of london charms uk realm, cheap links london the brand of the London filled links of london sweetie bracelet with vitality and motivation to links of london charm bracelets bring inspiration, Links of London shaping a series Links London of extremely Links London Jewelry rich freshness cheap links london and representative Links of london of the treasures. Links london High quality, Links London silver good reputation links london bracelets jewelry shop online

Posted by talent on 22/08/2010

Timepieces in the past: Tradition of replica watchesg originated from 1845 when Ferdinand A. Lange, a supplier of Imperial Court, established his first Zenith replica watches workshop in Glashutte. These workshops are well known all over the world due to the original Breitling watches produced by Julius Assmann, Ferdinand A. Lange and Johan Durstein. Since then the timepieces marked "Glashutte" are where the necessity in quality and high precision is. The rules once set by the great masters are still strictly obeyed in the production of mechanical masterpieces. Challenge of time: The Company faced difficulties as the Second World War started. The production of the Wenger watches companies was also subdued to the war needs. For example, Glashutte chronometers for pilots were classified during the second year of war. During the 8th of May 1945 Soviet fighters were chasing the withdrawing German tank stanchion. As a result the premise of Glashutte factory was damaged by the shells. Later the factory was expropriated by the Soviet representatives. It was a period of silence for long 40 years. In 1994 the Company survived renaissance and started again the manufacturing of high quality Jaeger LeCoultre replica watches maintaining old masters' traditions. Gucci replica masterpieces: The Seiko watches movements are especially thoroughly assembled by hand with the details produced exclusively in Bvlgari replica watches workshops: this brings a real charm to the mechanical Ulysse Nardin replica watches with a marking 'Made in Germany'. Such Swiss Army Victorinox watches as Glashutte Original can appear only where the traditions are preserved. At the processing and in the production of new Baume & Mercier watches movements standard qualities are maintained and realized in high quality hand assembly so characteristic for Glashutte Original. During the most important stages of assembly influencing maximum precision and long life of movements, innovative technologies are applied. As a result the company can offer its Christian Bernard watches movements with the classical marking: "Made in Glashutte". This is the way that tradition continues.In 1999 manufacture united one of the classical complicated functions with the modern tendencies: there appeared an eternal calendar with the wide ("panoramic") date window. A very large window is located on the dial in "two o'clock" position. Thus a combination of the traditional Replica Franck Muller watches movements with up-to-date requirements for precision and readability appeared.Practical luxury – it's a characteristic feature of Corum replica for those who appreciate reliability and functionality. Even though Replica Jaeger LeCoultre watches are not manually manufactured, they are the optimal combination of high precision and longevity: timing Replica Citizen watches are beyond the control of time. In our on-line shop you will find illustrations to every model of Bell & Ross replica watches you might like. Simply click on the picture of Replica Christian Dior watches you'd like to get. By the early 20th century, his three grandsons, Louis, Jacques and Pierre, were successfully managing Cartier boutiques in Paris, London and New York. The first true Accutron replica, the Santos, designed by Louis and named for Alberto Santos-Dumont, a dashing Brazilian aviator, was introduced in 1904. Timberland replica followed soon after in 1906. In 1910, Louis created and patented the deployant folding clasp. 1917 saw the introduction of the famous Replica Zenith. Long regarded as the single most important and influential Swiss watches design of the 20th century, the distinctive timepiece was designed in tribute to the Allied Tank commanders who helped defend France during World War I. Buy your Mont Blanc replica - which make you look rich at a fraction of the cost.

Posted by thefirstwatches on 31/08/2010

Ajouter un commentaire