SlideShare a Scribd company logo
Bargento 2015
Magento performances
Best practices 2015
LEADER en INFOGERANCE ECOMMERCE
EXPERT en TRES HAUTE SECURITE
Grow your business safely
WWW.NBS-SYSTEM.COM
7 years of experience
Magento performances
Best practices 2015
Realities and the myths
• Myth: SSD disks are a major key to performances
• Myth: HHVM could save us
• Myth: Varnish will save us
• Reality: PHP is the bottleneck
• Reality: MySQL is overly queried by Magento
• Reality: separation is a key
• Reality: added code is often the root cause of problems
3Présenté par Philippe Humeau
Most common problems
• Misconfigured cache systems
• Not leveraging the Reverse Proxies’ help
• Crowded .htaccess files (& lots of them)
• Crowded databases
• Terrible SQL queries
• Wrong design (load all products on the homepage)
4Présenté par Philippe Humeau
PHP
Magento performances
Best practices 2015
PHP: FPM can help but, first, version matters a lot
6Présenté par Philippe Humeau
PHP versions in
use in our parc
PHP 5.2
3%
PHP 5.3
51%
PHP 5.4
37%
PHP 5.5
9%
PHP: FPM can help but, first, version matters a lot
PHP performances progresses
7Présenté par Philippe Humeau
PHP 5.3 (deprecated) → PHP 5.6 +39,6%
PHP 5.4 (end of life) → PHP 5.6 +12,7%
PHP 5.5 → PHP 5.6 +3,5%
PHP FPM instead of Mod PHP +18,6%
Nginc + PHP FPM vs Apache PHP FPM Marginal
PHP 7 or HHVM vs PHP 5.6 *experimental* +200%
PHP: benefits of a 3 tiers architecture with FPM
8Présenté par Philippe Humeau
• Better layers and function separation (view, logic, data)
• Better stability through process independency
• More efficient resources consumption
• Easier troubleshooting
• Capacity to boost specific tiers depending on the need
MySQL
Magento performances
Best practices 2015
MySQL: Percona, a transparent booster
Not a single change needed, just pure bonus.
10Présenté par Philippe Humeau
MySQL 5.5 → MySQL 5.6 +17%
MySQL + Percona +20%
MySQL + Percona + XtraDB Not meaningful
Database: separate your key tables
11Présenté par Philippe Humeau
• Magento can use different database servers
• Based on accessed tables
• It is easier to specialize/customize their settings
• It avoids delaying one request, blocked by another
• Allows for more granularity (catalog, orders, logs, etc.)
• Can separate reads & writes (hence locks)
Database: some key settings
12Présenté par Philippe Humeau
• « Defaults » settings are not available since they depend on the DB
content
• Cache query is nearly mostly inefficient (& always > 1000
queries/sec)
– innodb_thread_concurrency
– table_open_cache (should be big enough to store modules tables)
– innodb_read_io_threads
– innodb_write_io_threads
– innodb_buffer_pool_size (big enough to store both data & indexes)
– max_heap_table_size
– tmp_table_size
Clean the database often & defragment them
13Présenté par Philippe Humeau
Can I do it with my Magento?
Magento performances
Best practices 2015
Versions & compatibility
15Présenté par Philippe Humeau
Caches
Magento performances
Best practices 2015
Black cache – PHP validates & assembles
17Présenté par Philippe Humeau
FCP very few PHP calls
18Présenté par Philippe Humeau
Custom blocks: performance killers
19Présenté par Philippe Humeau
When caches are inefficient
Example of a wrongly configured fast/slow cache duel
20Présenté par Philippe Humeau
When caches are inefficient
Example of a cache limit at 80% filling reached
Careful, 1.14.0 has compatibility issues with Redis 2.6.x
Memcached prior to 1.4.20 has a bug triggered under heavy load
21Présenté par Philippe Humeau
Key local.xml settings
22Présenté par Philippe Humeau
• Caches
– <slow_backend_store_data>0</slow_backend_store_data>
– <auto_refresh_fast_cache>0</auto_refresh_fast_cache>
– <compress_data>0</compress_data>
– <compress_tags>0</compress_tags>
– <lifetimelimit>86400</lifetimelimit>
• Sessions
– <timeout>3</timeout> <!-- 2.5 can lead to problems -->
– <max_concurrency>10</max_concurrency>
Varnish: amplifying the good, not hiding the worse
23Présenté par Philippe Humeau
• The problem
– Magento sends the frontend cookie with every request
– This keeps Varnish from being efficient
• Keeping SSL under control
– SSL pages are not cachable by Varnish (with Apache)
– Delay the use of SSL to Tunnel & BO (non cachable anyway)
• Use ESI best practices
– To properly leverage Varnish FPC, one needs to « punch holes »
– Those holes are filled by the dynamic information coming from the
server (server side included)
– The other parts of the page are FPCed (no PHP calls)
– Magento’s extension, « Turpenting » does this
Use Quanta Computing
24Présenté par Philippe Humeau
• In depth Magento troubleshooting
– Allow to identify bottlenecks
– Allow to measure a per user resource consumption
– Tracks blocks generation timings
• Tracking performances overtime
– Can monitor cache flush
– Can relate new code in production with performance variation
Code
Magento performances
Best practices 2015
Bad added code is the main pain point
26Présenté par Philippe Humeau
• Community extensions
– Most plugins are not tested by Magento
– Most are utterly wrongly done or unoptimized
– Loading too many of them burdens the whole Magento
• Home-made custom code & extensions
– Your blocks are unknown from Magento’s cache system
– Be careful about the endless « Natural Join » queries
– Test/monitor your site before and after new code is added
– Never, ever touch the CORE (or we kill a kitten)
Bad templates are no better
27Présenté par Philippe Humeau
• Sleek design is the key
– Don’t overcrowd the pages with useless features
– Don’t load too many categories / products on the homepage
– Avoid including lots of gadgets like Facebook
– Avoid including too many external services / JS
– Try to Ajaxify things
– K.I.S.S: Keep It Super Simple
– Don’t load tons of extensions as soon as the homepage
– Avoid CSS/HTML/JS errors
– Load images at the display size (not 3Mo for 300ko displayed)
– Avoid having too many (Magento) blocks on pages
– Avoid all information deactivating Varnish or FPC
Architecture
Magento performances
Best practices 2015
One server, one role
29Présenté par Philippe Humeau
• Caches
– Redis instances MUST be separated
– Even Redis databases should be separated (especially for multi stores)
– Redis doesn’t support latency
– So the cohabitation with DB, PHP or Apache/Nginx is bad
• PHP
– Separated processes (FPM) are better
– Separation of BO / FO / order tunnels with SSL allows for better
performances
– No need to handcuff them with the Web server
• Database
– Separate reads from writes
– Isolate highly demanded tables in another instance
Warnings on latency issues
30Présenté par Philippe Humeau
• Database
– Machines, to be redundant, have to be in separated datacenters
– Even a 2 ms latency makes a difference in the database output
• Redis
– It’s even worse for Redis
Amazon
Magento performances
Best practices 2015
AWS: use native tools
32Présenté par Philippe Humeau
• Taking advantage of the *real* AWS killer feature
– A Magento can be done the same way on Amazon, but you would miss
90% of the benefits of AWS
– Leveraging RDS (Postgres, Oracle, Mssql, MySQL, Aurora) is key
– RDS allows autoscalling, auto backup, auto update, replication in multi
AZ
– ELC allows to use Memcached / Redis in multi zone & fail over
– Leveraging ELB, R53, Cloud front and S3 allows a shop to be nicely
distributed
AWS: adjustments needed
33Présenté par Philippe Humeau
• No NFS or shared filesystem as such
– Use an extension to distribute media to S3 buckets
– The medias cannot be modified only on one machine
– The deployment systems must be adapted
– File locks can be tricky to handle
– Generated reports are usually local to the server
– The backoffice is handled differently (and isolated)
– Thumbnails are per servers, meaning a different way to share
Auto Scaling Group: doable, but technical
34Présenté par Philippe Humeau
• Auto Scaling Groups
– Fantastic on paper but not natively supported in Magento
– Can be achieved in several ways
– EBS can be counter productive, ephemeral FS can be better
– Since the extensible machines are mounted & dismounted on the fly,
scripts will have to post process the installation
– Doable but need a perfectly « dry » setup
– Threshold can be tricky to configure
– Less than 1/1000 of Magento stores are running (and can run) on AWS
Processing & DevOps are the key to success
Fine tuning
35Présenté par Philippe Humeau
• Caches
– Aoe_AsyncCache
– Aoe_CacheCleaner
– Aoe_static (make page cachable by Varnish)
• Magento
– Disable logs on high throughput instances
– Separate heavy duty tables in different RDS instances
http://bit.ly/1FWjn5p : Angry birds in the Cloud
http://bit.ly/1N3fuev : high performance Magento on Amazon
http://bit.ly/1R2jPiI : Basic tips & tricks about Magento per
AWS: a different architecture
36Présenté par Philippe Humeau
Code publishing
Magento performances
Best practices 2015
Code publishing automation
38Présenté par Philippe Humeau
• Using Git|Jenkins|Chef|Subversion|Capistrano|Turtoise
– Allows to keep track of versioning
– Allows to roll back when the site go AWOL
– Allows to use post process scripts & report
• Automating the code publishing
– The main difference is usually the local.xml file
– And some databases settings potentially
– Scripts can (& should) do the job
– Rollback should be thought carefully because of the orders registered
between the new and old site database
Contact
NBS System
Adresse :
8 rue Bernard Buffet,
Immeuble Le Cardinet – 5ème étage
75017 Paris
Mail : contact@nbs-system.com
Téléphone : +33.1.58.56.60.80
Support technique : +33.1.58.56.60.88
Fax : +33.1.58.56.60.81
39
Atelier présenté le 13 octobre 2015 au
Bargento 2015 par Philippe Humeau
Présenté par Philippe Humeau

More Related Content

Similar to Magento performances 2015 best practices

Magento performance & optimisation best practices
Magento performance & optimisation best practicesMagento performance & optimisation best practices
Magento performance & optimisation best practices
Philippe Humeau
 
Zendcon scaling magento
Zendcon scaling magentoZendcon scaling magento
Zendcon scaling magento
Mathew Beane
 
Phpworld.2015 scaling magento
Phpworld.2015 scaling magentoPhpworld.2015 scaling magento
Phpworld.2015 scaling magento
Mathew Beane
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
SiteGround.com
 
Magento scalability from the trenches (Meet Magento Sweden 2016)
Magento scalability from the trenches (Meet Magento Sweden 2016)Magento scalability from the trenches (Meet Magento Sweden 2016)
Magento scalability from the trenches (Meet Magento Sweden 2016)
Divante
 
5 Things to Ask Your Virtualization Administrator
5 Things to Ask Your Virtualization Administrator5 Things to Ask Your Virtualization Administrator
5 Things to Ask Your Virtualization Administrator
Dell Virtualization Operations Management
 
Lonestar php scalingmagento
Lonestar php scalingmagentoLonestar php scalingmagento
Lonestar php scalingmagento
Mathew Beane
 
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
WordCamp Harare
 
WordCamp Harare 2016 - Site Speed = Success
WordCamp Harare 2016 - Site Speed = SuccessWordCamp Harare 2016 - Site Speed = Success
WordCamp Harare 2016 - Site Speed = Success
Anthony Somerset
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011
Wim Godden
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
Wim Godden
 
MagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagentoMagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagento
Kirill Morozov
 
Webinar: IBM Connections Adminblast
Webinar: IBM Connections AdminblastWebinar: IBM Connections Adminblast
Webinar: IBM Connections Adminblast
panagenda
 
Webinar: IBM Connections Adminblast
Webinar: IBM Connections AdminblastWebinar: IBM Connections Adminblast
Webinar: IBM Connections Adminblast
Nico Meisenzahl
 
MySQL Performance - Best practices
MySQL Performance - Best practices MySQL Performance - Best practices
MySQL Performance - Best practices
Ted Wennmark
 
IBM Connect 2014 BP103: Ready, Aim, Fire: Mastering the Latest in the Adminis...
IBM Connect 2014 BP103: Ready, Aim, Fire: Mastering the Latest in the Adminis...IBM Connect 2014 BP103: Ready, Aim, Fire: Mastering the Latest in the Adminis...
IBM Connect 2014 BP103: Ready, Aim, Fire: Mastering the Latest in the Adminis...
Benedek Menesi
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment
Jean-François Gagné
 
Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!
WordCamp Cape Town
 
Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011
Wim Godden
 
Introduction To Apache Mesos
Introduction To Apache MesosIntroduction To Apache Mesos
Introduction To Apache Mesos
Timothy St. Clair
 

Similar to Magento performances 2015 best practices (20)

Magento performance & optimisation best practices
Magento performance & optimisation best practicesMagento performance & optimisation best practices
Magento performance & optimisation best practices
 
Zendcon scaling magento
Zendcon scaling magentoZendcon scaling magento
Zendcon scaling magento
 
Phpworld.2015 scaling magento
Phpworld.2015 scaling magentoPhpworld.2015 scaling magento
Phpworld.2015 scaling magento
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
 
Magento scalability from the trenches (Meet Magento Sweden 2016)
Magento scalability from the trenches (Meet Magento Sweden 2016)Magento scalability from the trenches (Meet Magento Sweden 2016)
Magento scalability from the trenches (Meet Magento Sweden 2016)
 
5 Things to Ask Your Virtualization Administrator
5 Things to Ask Your Virtualization Administrator5 Things to Ask Your Virtualization Administrator
5 Things to Ask Your Virtualization Administrator
 
Lonestar php scalingmagento
Lonestar php scalingmagentoLonestar php scalingmagento
Lonestar php scalingmagento
 
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
Site Speed = Success – Optimising WordPress from the Server Up - Presented by...
 
WordCamp Harare 2016 - Site Speed = Success
WordCamp Harare 2016 - Site Speed = SuccessWordCamp Harare 2016 - Site Speed = Success
WordCamp Harare 2016 - Site Speed = Success
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
MagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagentoMagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagento
 
Webinar: IBM Connections Adminblast
Webinar: IBM Connections AdminblastWebinar: IBM Connections Adminblast
Webinar: IBM Connections Adminblast
 
Webinar: IBM Connections Adminblast
Webinar: IBM Connections AdminblastWebinar: IBM Connections Adminblast
Webinar: IBM Connections Adminblast
 
MySQL Performance - Best practices
MySQL Performance - Best practices MySQL Performance - Best practices
MySQL Performance - Best practices
 
IBM Connect 2014 BP103: Ready, Aim, Fire: Mastering the Latest in the Adminis...
IBM Connect 2014 BP103: Ready, Aim, Fire: Mastering the Latest in the Adminis...IBM Connect 2014 BP103: Ready, Aim, Fire: Mastering the Latest in the Adminis...
IBM Connect 2014 BP103: Ready, Aim, Fire: Mastering the Latest in the Adminis...
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment
 
Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!
 
Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011
 
Introduction To Apache Mesos
Introduction To Apache MesosIntroduction To Apache Mesos
Introduction To Apache Mesos
 

Recently uploaded

Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Neo4j
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
Mydbops
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
christinelarrosa
 
ScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking ReplicationScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking Replication
ScyllaDB
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)
HarpalGohil4
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
Fwdays
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
DianaGray10
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Containers & AI - Beauty and the Beast!?!
Containers & AI - Beauty and the Beast!?!Containers & AI - Beauty and the Beast!?!
Containers & AI - Beauty and the Beast!?!
Tobias Schneck
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
FilipTomaszewski5
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 

Recently uploaded (20)

Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid ResearchHarnessing the Power of NLP and Knowledge Graphs for Opioid Research
Harnessing the Power of NLP and Knowledge Graphs for Opioid Research
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
 
ScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking ReplicationScyllaDB Tablets: Rethinking Replication
ScyllaDB Tablets: Rethinking Replication
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)AWS Certified Solutions Architect Associate (SAA-C03)
AWS Certified Solutions Architect Associate (SAA-C03)
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Containers & AI - Beauty and the Beast!?!
Containers & AI - Beauty and the Beast!?!Containers & AI - Beauty and the Beast!?!
Containers & AI - Beauty and the Beast!?!
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 

Magento performances 2015 best practices

  • 1. Bargento 2015 Magento performances Best practices 2015 LEADER en INFOGERANCE ECOMMERCE EXPERT en TRES HAUTE SECURITE Grow your business safely WWW.NBS-SYSTEM.COM
  • 2. 7 years of experience Magento performances Best practices 2015
  • 3. Realities and the myths • Myth: SSD disks are a major key to performances • Myth: HHVM could save us • Myth: Varnish will save us • Reality: PHP is the bottleneck • Reality: MySQL is overly queried by Magento • Reality: separation is a key • Reality: added code is often the root cause of problems 3Présenté par Philippe Humeau
  • 4. Most common problems • Misconfigured cache systems • Not leveraging the Reverse Proxies’ help • Crowded .htaccess files (& lots of them) • Crowded databases • Terrible SQL queries • Wrong design (load all products on the homepage) 4Présenté par Philippe Humeau
  • 6. PHP: FPM can help but, first, version matters a lot 6Présenté par Philippe Humeau PHP versions in use in our parc PHP 5.2 3% PHP 5.3 51% PHP 5.4 37% PHP 5.5 9%
  • 7. PHP: FPM can help but, first, version matters a lot PHP performances progresses 7Présenté par Philippe Humeau PHP 5.3 (deprecated) → PHP 5.6 +39,6% PHP 5.4 (end of life) → PHP 5.6 +12,7% PHP 5.5 → PHP 5.6 +3,5% PHP FPM instead of Mod PHP +18,6% Nginc + PHP FPM vs Apache PHP FPM Marginal PHP 7 or HHVM vs PHP 5.6 *experimental* +200%
  • 8. PHP: benefits of a 3 tiers architecture with FPM 8Présenté par Philippe Humeau • Better layers and function separation (view, logic, data) • Better stability through process independency • More efficient resources consumption • Easier troubleshooting • Capacity to boost specific tiers depending on the need
  • 10. MySQL: Percona, a transparent booster Not a single change needed, just pure bonus. 10Présenté par Philippe Humeau MySQL 5.5 → MySQL 5.6 +17% MySQL + Percona +20% MySQL + Percona + XtraDB Not meaningful
  • 11. Database: separate your key tables 11Présenté par Philippe Humeau • Magento can use different database servers • Based on accessed tables • It is easier to specialize/customize their settings • It avoids delaying one request, blocked by another • Allows for more granularity (catalog, orders, logs, etc.) • Can separate reads & writes (hence locks)
  • 12. Database: some key settings 12Présenté par Philippe Humeau • « Defaults » settings are not available since they depend on the DB content • Cache query is nearly mostly inefficient (& always > 1000 queries/sec) – innodb_thread_concurrency – table_open_cache (should be big enough to store modules tables) – innodb_read_io_threads – innodb_write_io_threads – innodb_buffer_pool_size (big enough to store both data & indexes) – max_heap_table_size – tmp_table_size
  • 13. Clean the database often & defragment them 13Présenté par Philippe Humeau
  • 14. Can I do it with my Magento? Magento performances Best practices 2015
  • 17. Black cache – PHP validates & assembles 17Présenté par Philippe Humeau
  • 18. FCP very few PHP calls 18Présenté par Philippe Humeau
  • 19. Custom blocks: performance killers 19Présenté par Philippe Humeau
  • 20. When caches are inefficient Example of a wrongly configured fast/slow cache duel 20Présenté par Philippe Humeau
  • 21. When caches are inefficient Example of a cache limit at 80% filling reached Careful, 1.14.0 has compatibility issues with Redis 2.6.x Memcached prior to 1.4.20 has a bug triggered under heavy load 21Présenté par Philippe Humeau
  • 22. Key local.xml settings 22Présenté par Philippe Humeau • Caches – <slow_backend_store_data>0</slow_backend_store_data> – <auto_refresh_fast_cache>0</auto_refresh_fast_cache> – <compress_data>0</compress_data> – <compress_tags>0</compress_tags> – <lifetimelimit>86400</lifetimelimit> • Sessions – <timeout>3</timeout> <!-- 2.5 can lead to problems --> – <max_concurrency>10</max_concurrency>
  • 23. Varnish: amplifying the good, not hiding the worse 23Présenté par Philippe Humeau • The problem – Magento sends the frontend cookie with every request – This keeps Varnish from being efficient • Keeping SSL under control – SSL pages are not cachable by Varnish (with Apache) – Delay the use of SSL to Tunnel & BO (non cachable anyway) • Use ESI best practices – To properly leverage Varnish FPC, one needs to « punch holes » – Those holes are filled by the dynamic information coming from the server (server side included) – The other parts of the page are FPCed (no PHP calls) – Magento’s extension, « Turpenting » does this
  • 24. Use Quanta Computing 24Présenté par Philippe Humeau • In depth Magento troubleshooting – Allow to identify bottlenecks – Allow to measure a per user resource consumption – Tracks blocks generation timings • Tracking performances overtime – Can monitor cache flush – Can relate new code in production with performance variation
  • 26. Bad added code is the main pain point 26Présenté par Philippe Humeau • Community extensions – Most plugins are not tested by Magento – Most are utterly wrongly done or unoptimized – Loading too many of them burdens the whole Magento • Home-made custom code & extensions – Your blocks are unknown from Magento’s cache system – Be careful about the endless « Natural Join » queries – Test/monitor your site before and after new code is added – Never, ever touch the CORE (or we kill a kitten)
  • 27. Bad templates are no better 27Présenté par Philippe Humeau • Sleek design is the key – Don’t overcrowd the pages with useless features – Don’t load too many categories / products on the homepage – Avoid including lots of gadgets like Facebook – Avoid including too many external services / JS – Try to Ajaxify things – K.I.S.S: Keep It Super Simple – Don’t load tons of extensions as soon as the homepage – Avoid CSS/HTML/JS errors – Load images at the display size (not 3Mo for 300ko displayed) – Avoid having too many (Magento) blocks on pages – Avoid all information deactivating Varnish or FPC
  • 29. One server, one role 29Présenté par Philippe Humeau • Caches – Redis instances MUST be separated – Even Redis databases should be separated (especially for multi stores) – Redis doesn’t support latency – So the cohabitation with DB, PHP or Apache/Nginx is bad • PHP – Separated processes (FPM) are better – Separation of BO / FO / order tunnels with SSL allows for better performances – No need to handcuff them with the Web server • Database – Separate reads from writes – Isolate highly demanded tables in another instance
  • 30. Warnings on latency issues 30Présenté par Philippe Humeau • Database – Machines, to be redundant, have to be in separated datacenters – Even a 2 ms latency makes a difference in the database output • Redis – It’s even worse for Redis
  • 32. AWS: use native tools 32Présenté par Philippe Humeau • Taking advantage of the *real* AWS killer feature – A Magento can be done the same way on Amazon, but you would miss 90% of the benefits of AWS – Leveraging RDS (Postgres, Oracle, Mssql, MySQL, Aurora) is key – RDS allows autoscalling, auto backup, auto update, replication in multi AZ – ELC allows to use Memcached / Redis in multi zone & fail over – Leveraging ELB, R53, Cloud front and S3 allows a shop to be nicely distributed
  • 33. AWS: adjustments needed 33Présenté par Philippe Humeau • No NFS or shared filesystem as such – Use an extension to distribute media to S3 buckets – The medias cannot be modified only on one machine – The deployment systems must be adapted – File locks can be tricky to handle – Generated reports are usually local to the server – The backoffice is handled differently (and isolated) – Thumbnails are per servers, meaning a different way to share
  • 34. Auto Scaling Group: doable, but technical 34Présenté par Philippe Humeau • Auto Scaling Groups – Fantastic on paper but not natively supported in Magento – Can be achieved in several ways – EBS can be counter productive, ephemeral FS can be better – Since the extensible machines are mounted & dismounted on the fly, scripts will have to post process the installation – Doable but need a perfectly « dry » setup – Threshold can be tricky to configure – Less than 1/1000 of Magento stores are running (and can run) on AWS Processing & DevOps are the key to success
  • 35. Fine tuning 35Présenté par Philippe Humeau • Caches – Aoe_AsyncCache – Aoe_CacheCleaner – Aoe_static (make page cachable by Varnish) • Magento – Disable logs on high throughput instances – Separate heavy duty tables in different RDS instances http://bit.ly/1FWjn5p : Angry birds in the Cloud http://bit.ly/1N3fuev : high performance Magento on Amazon http://bit.ly/1R2jPiI : Basic tips & tricks about Magento per
  • 36. AWS: a different architecture 36Présenté par Philippe Humeau
  • 38. Code publishing automation 38Présenté par Philippe Humeau • Using Git|Jenkins|Chef|Subversion|Capistrano|Turtoise – Allows to keep track of versioning – Allows to roll back when the site go AWOL – Allows to use post process scripts & report • Automating the code publishing – The main difference is usually the local.xml file – And some databases settings potentially – Scripts can (& should) do the job – Rollback should be thought carefully because of the orders registered between the new and old site database
  • 39. Contact NBS System Adresse : 8 rue Bernard Buffet, Immeuble Le Cardinet – 5ème étage 75017 Paris Mail : contact@nbs-system.com Téléphone : +33.1.58.56.60.80 Support technique : +33.1.58.56.60.88 Fax : +33.1.58.56.60.81 39 Atelier présenté le 13 octobre 2015 au Bargento 2015 par Philippe Humeau Présenté par Philippe Humeau