Top Banner
Sécurité et performance Security and performance SOLDES: N’embouteillez pas vos clients dans vos rayons !
20

Performance barcampfinal

Dec 28, 2014

Download

Documents

Oxalide

 
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Performance barcampfinal

Sécurité et performanceSecurity and performance

SOLDES: N’embouteillez pas vos clients dans vos

rayons !

Page 2: Performance barcampfinal
Page 3: Performance barcampfinal
Page 4: Performance barcampfinal

Sébastien LucasDirecteur associé Oxalide

[email protected]

Qui sommes nous ?About us ?

Rémi GaillardDéveloppeur PrestaShop

[email protected]

Page 5: Performance barcampfinal

• Infogérance, design et conception d’infrastructure,Infrastructure Design, Hosting & Facilities management,

• Surveillance 24x7 proactive,24x7 monitoring,

• Optimisation et troubleshooting,Fine tuning and troubleshooting,

• Hébergeur de Prestashop et de ses clients depuis 2007Host of Prestashop & customers since 2007

Oxalide team

Page 6: Performance barcampfinal

• Un catalogue de plusieurs dizaines de milliers de produitsTens of thousands of products

• Plusieurs milliers de ventes par jours Several thousands of sales per day

• Une multiplication du trafic par 10 pendant les soldesTraffic increase by 10 during sales

Etude de cas : BebeoUse case : Bebeo

Z-enfant, Tartine et Chocolat , Melijoe3 boutiques

stores

Page 7: Performance barcampfinal

• Utilisez la dernière version stable de PrestashopUse the last stable version of PrestaShop

• Supprimez ou désactivez les modules et fonctionnalités non utiliséesRemove or disable unused modules and features

• Désactivez le module de statistiques et utilisez un outil externe (Google Analytics, Weborama, ...)Disable the statistics module and use external tool (Google Analytics, Weborama, ...)

Configurez au mieux PrestaShopPrestaShop Configuration

Page 8: Performance barcampfinal

Statique : qui n’est pas dynamiqueStatic : which is not dynamic

Rendez statiques un maximum d’éléments :

1. Page d’accueilLanding page

2. Page d’erreur 404404 error

3. Liste des catégoriesCategory listing

4. …

La clé de la performance : pensez statique!Improve performance: think static!

Page 9: Performance barcampfinal

• Videz les tables de statistiquesTruncate statistics tables

• Supprimez les paniers inutilisésRemove unused carts

• Supprimez les bons de réduction expirésRemove expired discounts

Contenu de la base de donnéesDatabase content

Page 10: Performance barcampfinal

Un design d’architecture scalable & fiableDesigned for scalability & reliability

Séparation des couches applicatives (Cache, PHP et BDD),Separate layers : caching, PHP & Databases

Penser scalabilitéThink scalable

Répartition de chargeImplement load balancing for multiple front-ends

Page 11: Performance barcampfinal

Optimisez le contenu statiqueThink static

Apache + PHP

Pshop

Lig

htt

pd

Apache + PHP

Pshop

SquidVarnish

HTML

HTML

HTML

Connected

users

1

2 5

6

7 8 9

3

3 4

MySQLd

Lig

htt

pd

Lig

htt

pd

/img/css/js

Page 12: Performance barcampfinal

• Utilisez des serveurs de caches,Use reverse proxies with a tuned policy,

• Séparez HTML, JS et CSS sur des noms de domaines différents,Separate HTML, Jscript & CSS on dedicated FQDN,

• Optimisez la délivrance du contenu statique avec un Webserver optimisé (Lighttpd ou nginx),Dedicate a specific and fine tuned web server to deliver static contents,

• Maximisez l’utilisation du cache du navigateurFeel confortable using browser caching

Page 13: Performance barcampfinal

• Configuration optimisée d’apache et de PHP (faible empreinte mémoire, adapté pour une trafic élevé, …)Finetuned apache and php configuration (low memory fingerprint, reliable behaviour on high amount of trafic)

• Utilisez un système de cache d’opcode PHP (APC ou eAccelerator)Use an opcode caching system for PHP (APC or eAccelerator)

• Implémentez un politique de Rewriting d’url statiqueUse a static policy for the Url Rewriting rules

• Optimisez MySQL pour pour InnoDBFinetune MySQL for InnoDB

Configuration serveur orientée performanceFinetune system & services

Page 14: Performance barcampfinal

Charge : Augmentez le nombre de frontauxWhen needed : Use your scalability

Load Balance

r

Apache + PHP

Pshop

front-01

1

2 5

6

3

4

MySQLd

DB-Master

Apache + PHP

Pshop

front-02

Apache + PHP

Pshop

front-03

Apache + PHP

Pshop

front-0X

MySQLd

DB-Slave

Page 15: Performance barcampfinal

• Augmentez le nombre de frontaux pour augmenter la capacité de traitementIncrease the number of your front-ends

• Utilisez des frontaux virtuels pour les moments clés (Soldes, Fêtes, etc.)Use virtual « on demand » servers for your key moments (sales, …)

• Attention au goulot d’étranglement sur le Master BDDRemain alert as to the behavior of your database

Page 16: Performance barcampfinal

Utiliser un serveur esclaveUse slave server

Load Balance

r

Apache + PHP

Pshop

front-01

1

2 5

6

3 4

MySQLd

Apache + PHP

Pshop

front-02

Apache + PHP

Pshop

front-03

Apache + PHP

Pshop

front-0X

MySQLd

Writein DB

Instant read

Readin DB

Page 17: Performance barcampfinal

Séparation des requêtes:Split queries:

- Ecriture (insert, update),Writing

- Lecture instantanée (panier,commandes…),Instant reading (cart, orders…)

- Lecture (Catalogue, produits..)

Reading(Catalog, products…)

Classe Db :

private static $_servers = array(

array('server' => _DB_SERVER_, 'user' => _DB_USER_,

'password' => _DB_PASSWD_, 'database' => _DB_NAME_),

array('server' => '192.168.0.3',

'user' => 'myuser', 'password' => 'mypassword', 'database' => 'mydatabase'));

Page 18: Performance barcampfinal

Charge : Scalabilité des slavesLoad : Scalability of slaves

Classe Db

Ou

Utiliser un load balancer

Use a transparent load balancer

Load Balance

r

Apache + PHP

Pshop

front-01

1

2 5

6

3 4

MySQLd

DB-Master

Apache + PHP

Pshop

front-02

Apache + PHP

Pshop

front-03

Apache + PHP

Pshop

front-0X

MySQLd

DB-Slave

Writein DB

Instant read

Readin DB

MySQLd

DB-Slave

MySQLd

DB-Slave

Load Balancer

Page 19: Performance barcampfinal

Screencast

Page 20: Performance barcampfinal

Des questions?Questions ?