SlideShare ist ein Scribd-Unternehmen logo
1 von 39
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

Weitere ähnliche Inhalte

Ähnlich wie Magento performances 2015 best practices

MagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagentoMagentoECG-UsingRedisasaCacheBackendinMagento
MagentoECG-UsingRedisasaCacheBackendinMagento
Kirill Morozov
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

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