SlideShare a Scribd company logo
1 of 20
Download to read offline
Mathew Beane
Mathew Beane
Director, Systems Engineering @ Robofirm
• It is not ready yet….
• We are finalizing a release of the core configuration soon.
• Moving to RHEL /CentOS 7
• Performance improvements from move to 7 are worth the wait.
• Hoping to see it ready for Lonestar PHP
Sneak Peak:
• Uses Puppetmaster to build out cluster
• Initial release should be the standard (n)webnodes + single db config
• Vagrant boxes will be available to allow for development environments
• Open-source e-commerce platform
• Based on Zend Framework 1
• Very flexible, it’s built to modify
• Extremely scalable, supports huge stores
• Market leader and still growing
• Magento 2 is right around the corner
• It’s is in development beta now
• http://magento.com/developers/magento2
Before you start:
 Application is optimized and clean
 Development Pipeline in place
 Deployment infrastructure is solid
 Rigorous testing protocols are in place
Get started:
 Add a Load Balancer
 Proxy Web Traffic to web(n) servers
 Cluster Redis using Sentinel / Twemproxy
 Add Varnish if application permits
 Add MySQL Read servers
 Build in auto-scaling and your done
• PHP 5.4+ - Must use PHP-FPM instead of mod_php
• Nginx is easier to use in a clustered environment
– The configurations are cleaner
– Proxy to PHP-FPM nodes it’s fast, clean and easy
• Nexcess Whitepaper: https://github.com/nexcess/ee-whitepaper-v1-configs
• Redis is the preferred cache for Magento
– Using Sentinel and twemproxy you can horizontally scale
– Cluster twemproxy to eliminate all single threaded bottlenecks and single points of
failure
• Turn off MySQL Query Caching – This is single threaded and not of use with Magento
• Varnish is great, however your application must be suitable
• Use Zend Server 8 Z-Ray to profile and tune your Magento Application
You must be able to package your
application in order to deploy it to a
cluster.
Application Packaging
Maintain separate packages for Core
Magento and all of your extensions.
Composer / Modman
Never edit core files. Ensure that you can
see any core file changes.
Keep a clean core
Choose a branching methodology and build
around it.
Release / Feature Branch
Build testing into all of your development
cycles, never release without complete
testing. Build unit tests where possible.
Testing
Make pull requests part of your workflow.
Use Pull Requests
• When deploying an application to a cluster of application servers this is a requirement
• There are many choices:
– Capistrano: Written in Ruby but well accepted and great to work with
– Jenkins: Another example of Deployment Automation
– Bamboo: Part of the Atlassian stack also includes testing and other features.
– Roll Your Own: This is more common, using bash scripts and other tools you can build a project
deployment tool fairly easily.
I highly suggest researching Fabrizo Branca’s work on the subject:
http://www.slideshare.net/aoepeople/rock-solid-magento
Also check out Joshua Warren’s slides on Test Driven Development and his stem to stern tutorial Rock
Solid Magento Development.
http://www.slideshare.net/joshuaswarren/
"Don't rate potential over performance."
- Jim Fassel
Blaze Meter
Using Blazemeter you can
easily build repeatable tests,
with very nice graphs.
(based on JMeter)
Gatling
http://gatling.io/
On par with Blazemeter.
JMeter
Very effective, without
having to purchase a SaaS
Siege
Can be used minimally to
simulate some types of load.
Vs.
HARDWARE
• HAProxy: a free fast and reliable solution
featuring high availability, load balancing and
proxying for TCP and HTTP-based
applications.
• HAProxy can be used for web servers,
database servers, Redis and any other TCP
based application.
• F5 Hardware load balancers are a standard
• Rackspace offers a very easy to use web
interface to maintain a hybrid infrastructure
• Hardware load balancers offer a turn-key
mature solution.
SOFTWARE
Before you start:
 Application is optimized and clean
 Development Pipeline in place
 Deployment infrastructure is solid
 Rigorous testing protocols are in place
Get started:
 Add a Load Balancer
 Proxy Web Traffic to web(n) servers
 Cluster Redis using Sentinel / Twemproxy
 Add Varnish if application permits
 Add MySQL Read servers
 Build in auto-scaling and your done
Hardware Load Balancer
HAProxy Load Balancer
Sentinel / twemproxy
High Availability
MySQL / Percona
Master/Slave
Single Write /
Multiple Read Servers
Database
Apache / Nginx
PHP 5.4 +
Multiple Web Servers
Varnish
Web
File Server (NFS / NAS)
Redis / Memcache
Deployment Tools
Monitoring
Other
Typical Cluster Components
Expensive, with many
features out of the box
that will make for an easy
turnkey solution.
Using Sentinel and
twemproxy wrapped by
your load balancer will
give you amazing
performance out of your
Redis cluster.
Read servers can be load
balanced with Magento.
This is easy to achieve,
but this doesn’t solve the
checkout issue.
Defacto software load
balancing and High
Availability server.
This is the most common
use for a load balancer,
and is a great place to
start your setup.
• Budget concerns will drive this decision
• Hosting Choices will affect availability, costs and toolsets
• Start locally with HAProxy and build test clusters using vagrant
• HAProxy can still be used, with a hardware load balancer in place.
• Simple to Load Balance, most sites start here
• Challenges include the following:
– Session Management: should be a no brainer if your using redis for sessions
– Shared filesystem: Use NFS for media, keep all code local to web servers
– Fencing: easily solved with either software or hardware
– Log Collection: Rsyslog or Splunk
• Keep the system builds simple, repeatable and automate if possible
• How to automate:
– Create an complete image to work from - include puppet so it can pull from puppetmaster
– Puppetmaster spins up your webserver stack
– You have your deployment process in place, so tie it into puppet and pull the code
• Be prepared to lose nodes, the more you have the more likely failure is
• When a node runs amok, you must be prepared to kill it dead
“Redis clustering using sentinel is easy to set up. Adding twemproxy allows for a highly scalable Redis cluster
and you get auto fail over and a ton of other benefits with this configuration. This arrangement can also
remove your Redis single point of failure.”
http://aepod.com/clustering-magento-redis-caching-with-sentinel-keepalived-twemproxy-and-twemproxy-agent/
• Sentinel Monitors Redis clusters
• twemproxy handles sharding
• twemproxy agent monitors sentinel
• Very robust when setup, nothing is single
threaded, everything is HA and the
speed….
• Pretty much transparent to Magento
despite the complexity
• Percona XtraDB to cluster MySQL
• Percona XtraBackup for duplicating and rebuilding nodes
• Percona Toolkit to help debug any issues your running into
• Difficult to scale Write Servers
• Scale out your read servers as needed, but MySQL reads are rarely the bottleneck
• Typically Slave server is used for backup and hot swap, NOT clustering.
A couple quick tips:
• Not all tables in Magento are InnoDB, converting the MyISAM and Memory tables is OK
• Usually overtime you will need to be able to kill read servers and refresh (STONITH)
• Use your Master server as a read server in the load balancer pool, when you kill all your read
servers, it can fall back to master.
• Detailed Auto-Scaling will have to wait until LonestarPHP
– 3 Hour tutorial, which will include web server auto-scaling using puppet
– April 16th 2015 in Dallas
• Insert puzzle building analogy joke here: http://www.wikihow.com/Assemble-Jigsaw-Puzzles
• Each hosting environment has its own quirks and add on top of that the business logic
requirements you will almost always have a unique infrastructure for every client
• Build small pieces and work them into the larger picture, you can get a lot of performance
with a few minor changes.
• Test everything you do, keep detailed notes on the configurations and compare against the
previous tests
• Mathew Beane <mbeane@robofirm.com>
• Twitter: @aepod
• Blog: http://aepod.com/
Rate this talk:
https://joind.in/13837
(Slides will be available)
Thanks to the following:
My Family
The Magento Community
Robofirm
Fabrizo Branca (deployments)
Thjis Feryn (sentinel)
Rackspace

More Related Content

What's hot

Magento security best practices 2015
Magento security best practices 2015Magento security best practices 2015
Magento security best practices 2015Philippe Humeau
 
Magento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Magento 2.2: It's Coming Right For You! | Colorado Magento MeetupMagento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Magento 2.2: It's Coming Right For You! | Colorado Magento MeetupKelly Mason
 
Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012eballisty
 
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for EhchacheScale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for EhchacheColdFusionConference
 
25 Apache Performance Tips
25 Apache Performance Tips25 Apache Performance Tips
25 Apache Performance TipsMonitis_Inc
 
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyNginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyAmit Aggarwal
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And ScalabilityJason Ragsdale
 
Apache Camel: Jetty Component With Example
Apache Camel: Jetty Component With ExampleApache Camel: Jetty Component With Example
Apache Camel: Jetty Component With ExampleAmit Aggarwal
 
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web server
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web serverNginx 0.8.x + php 5.2.13 (fast cgi) setup web server
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web serverwruben
 
Improve ColdFusion Performance by tuning the Connector and using ColdFusion-T...
Improve ColdFusion Performance by tuning the Connector and using ColdFusion-T...Improve ColdFusion Performance by tuning the Connector and using ColdFusion-T...
Improve ColdFusion Performance by tuning the Connector and using ColdFusion-T...ColdFusionConference
 
Memcached B box presentation
Memcached B box presentationMemcached B box presentation
Memcached B box presentationNagesh Chinkeri
 
Nginx internals
Nginx internalsNginx internals
Nginx internalsliqiang xu
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltStack
 
The app server, web server and everything in between
The app server, web server and everything in betweenThe app server, web server and everything in between
The app server, web server and everything in betweenColdFusionConference
 
Windows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHPWindows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHPTim Keller
 
ServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBIServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBIGert Vanthienen
 
CIRCUIT 2015 - Monitoring AEM
CIRCUIT 2015 - Monitoring AEMCIRCUIT 2015 - Monitoring AEM
CIRCUIT 2015 - Monitoring AEMICF CIRCUIT
 

What's hot (20)

Magento security best practices 2015
Magento security best practices 2015Magento security best practices 2015
Magento security best practices 2015
 
Magento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Magento 2.2: It's Coming Right For You! | Colorado Magento MeetupMagento 2.2: It's Coming Right For You! | Colorado Magento Meetup
Magento 2.2: It's Coming Right For You! | Colorado Magento Meetup
 
Tomcatx performance-tuning
Tomcatx performance-tuningTomcatx performance-tuning
Tomcatx performance-tuning
 
Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012
 
Manual 5
Manual 5Manual 5
Manual 5
 
Fastest Servlets in the West
Fastest Servlets in the WestFastest Servlets in the West
Fastest Servlets in the West
 
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for EhchacheScale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
 
25 Apache Performance Tips
25 Apache Performance Tips25 Apache Performance Tips
25 Apache Performance Tips
 
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyNginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
 
Apache Camel: Jetty Component With Example
Apache Camel: Jetty Component With ExampleApache Camel: Jetty Component With Example
Apache Camel: Jetty Component With Example
 
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web server
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web serverNginx 0.8.x + php 5.2.13 (fast cgi) setup web server
Nginx 0.8.x + php 5.2.13 (fast cgi) setup web server
 
Improve ColdFusion Performance by tuning the Connector and using ColdFusion-T...
Improve ColdFusion Performance by tuning the Connector and using ColdFusion-T...Improve ColdFusion Performance by tuning the Connector and using ColdFusion-T...
Improve ColdFusion Performance by tuning the Connector and using ColdFusion-T...
 
Memcached B box presentation
Memcached B box presentationMemcached B box presentation
Memcached B box presentation
 
Nginx internals
Nginx internalsNginx internals
Nginx internals
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
 
The app server, web server and everything in between
The app server, web server and everything in betweenThe app server, web server and everything in between
The app server, web server and everything in between
 
Windows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHPWindows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHP
 
ServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBIServiceMix 4 -- Integrating OSGi with JBI
ServiceMix 4 -- Integrating OSGi with JBI
 
CIRCUIT 2015 - Monitoring AEM
CIRCUIT 2015 - Monitoring AEMCIRCUIT 2015 - Monitoring AEM
CIRCUIT 2015 - Monitoring AEM
 

Viewers also liked

Z-Ray: A customizable development tool belt (Zendcon 2016)
Z-Ray: A customizable development tool belt (Zendcon 2016)Z-Ray: A customizable development tool belt (Zendcon 2016)
Z-Ray: A customizable development tool belt (Zendcon 2016)Mathew Beane
 
php[world] Magento101
php[world] Magento101php[world] Magento101
php[world] Magento101Mathew Beane
 
Elk ruminating on logs
Elk ruminating on logsElk ruminating on logs
Elk ruminating on logsMathew Beane
 
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishMagento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishYireo
 
ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)Mathew Beane
 
Checkout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max PronkoCheckout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max PronkoMax Pronko
 
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Mathew Beane
 
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
 
MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2Mathew Beane
 

Viewers also liked (9)

Z-Ray: A customizable development tool belt (Zendcon 2016)
Z-Ray: A customizable development tool belt (Zendcon 2016)Z-Ray: A customizable development tool belt (Zendcon 2016)
Z-Ray: A customizable development tool belt (Zendcon 2016)
 
php[world] Magento101
php[world] Magento101php[world] Magento101
php[world] Magento101
 
Elk ruminating on logs
Elk ruminating on logsElk ruminating on logs
Elk ruminating on logs
 
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishMagento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
 
ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)
 
Checkout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max PronkoCheckout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max Pronko
 
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2
 
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)
 
MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2MidwestPHP - Getting Started with Magento 2
MidwestPHP - Getting Started with Magento 2
 

Similar to Magento Cluster Configuration

Moving Windows Applications to the Cloud
Moving Windows Applications to the CloudMoving Windows Applications to the Cloud
Moving Windows Applications to the CloudRightScale
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal infoSynapseindiappsdevelopment
 
Virtualizing Tier One Applications - Varrow
Virtualizing Tier One Applications - VarrowVirtualizing Tier One Applications - Varrow
Virtualizing Tier One Applications - VarrowAndrew Miller
 
Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experienceAlex Tumanoff
 
Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experienceIgor Anishchenko
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance DrupalChapter Three
 
Sanger, upcoming Openstack for Bio-informaticians
Sanger, upcoming Openstack for Bio-informaticiansSanger, upcoming Openstack for Bio-informaticians
Sanger, upcoming Openstack for Bio-informaticiansPeter Clapham
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuis Rodríguez Castromil
 
Connections install in 45 mins
Connections install in 45 minsConnections install in 45 mins
Connections install in 45 minsSharon James
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOpsEklove Mohan
 
Docker for the enterprise
Docker for the enterpriseDocker for the enterprise
Docker for the enterpriseBert Poller
 
Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stackJohan Edstrom
 
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Andrew Miller
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!netzwelt12345
 
IBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the CloudIBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the CloudAndrew Coleman
 
DrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilityDrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilitycherryhillco
 
ThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsBrad Williams
 

Similar to Magento Cluster Configuration (20)

Moving Windows Applications to the Cloud
Moving Windows Applications to the CloudMoving Windows Applications to the Cloud
Moving Windows Applications to the Cloud
 
SynapseIndia drupal presentation on drupal info
SynapseIndia drupal  presentation on drupal infoSynapseIndia drupal  presentation on drupal info
SynapseIndia drupal presentation on drupal info
 
Virtualizing Tier One Applications - Varrow
Virtualizing Tier One Applications - VarrowVirtualizing Tier One Applications - Varrow
Virtualizing Tier One Applications - Varrow
 
Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experience
 
Overview of PaaS: Java experience
Overview of PaaS: Java experienceOverview of PaaS: Java experience
Overview of PaaS: Java experience
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
 
Cloud Orchestration is Broken
Cloud Orchestration is BrokenCloud Orchestration is Broken
Cloud Orchestration is Broken
 
Sanger, upcoming Openstack for Bio-informaticians
Sanger, upcoming Openstack for Bio-informaticiansSanger, upcoming Openstack for Bio-informaticians
Sanger, upcoming Openstack for Bio-informaticians
 
Flexible compute
Flexible computeFlexible compute
Flexible compute
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
 
Connections install in 45 mins
Connections install in 45 minsConnections install in 45 mins
Connections install in 45 mins
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
 
Docker for the enterprise
Docker for the enterpriseDocker for the enterprise
Docker for the enterprise
 
Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stack
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!
 
IBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the CloudIBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the Cloud
 
DrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilityDrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalability
 
ThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.js
 

Recently uploaded

Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 

Recently uploaded (20)

Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 

Magento Cluster Configuration

  • 2. Mathew Beane Director, Systems Engineering @ Robofirm
  • 3.
  • 4. • It is not ready yet…. • We are finalizing a release of the core configuration soon. • Moving to RHEL /CentOS 7 • Performance improvements from move to 7 are worth the wait. • Hoping to see it ready for Lonestar PHP Sneak Peak: • Uses Puppetmaster to build out cluster • Initial release should be the standard (n)webnodes + single db config • Vagrant boxes will be available to allow for development environments
  • 5. • Open-source e-commerce platform • Based on Zend Framework 1 • Very flexible, it’s built to modify • Extremely scalable, supports huge stores • Market leader and still growing • Magento 2 is right around the corner • It’s is in development beta now • http://magento.com/developers/magento2
  • 6.
  • 7. Before you start:  Application is optimized and clean  Development Pipeline in place  Deployment infrastructure is solid  Rigorous testing protocols are in place Get started:  Add a Load Balancer  Proxy Web Traffic to web(n) servers  Cluster Redis using Sentinel / Twemproxy  Add Varnish if application permits  Add MySQL Read servers  Build in auto-scaling and your done
  • 8. • PHP 5.4+ - Must use PHP-FPM instead of mod_php • Nginx is easier to use in a clustered environment – The configurations are cleaner – Proxy to PHP-FPM nodes it’s fast, clean and easy • Nexcess Whitepaper: https://github.com/nexcess/ee-whitepaper-v1-configs • Redis is the preferred cache for Magento – Using Sentinel and twemproxy you can horizontally scale – Cluster twemproxy to eliminate all single threaded bottlenecks and single points of failure • Turn off MySQL Query Caching – This is single threaded and not of use with Magento • Varnish is great, however your application must be suitable • Use Zend Server 8 Z-Ray to profile and tune your Magento Application
  • 9. You must be able to package your application in order to deploy it to a cluster. Application Packaging Maintain separate packages for Core Magento and all of your extensions. Composer / Modman Never edit core files. Ensure that you can see any core file changes. Keep a clean core Choose a branching methodology and build around it. Release / Feature Branch Build testing into all of your development cycles, never release without complete testing. Build unit tests where possible. Testing Make pull requests part of your workflow. Use Pull Requests
  • 10. • When deploying an application to a cluster of application servers this is a requirement • There are many choices: – Capistrano: Written in Ruby but well accepted and great to work with – Jenkins: Another example of Deployment Automation – Bamboo: Part of the Atlassian stack also includes testing and other features. – Roll Your Own: This is more common, using bash scripts and other tools you can build a project deployment tool fairly easily. I highly suggest researching Fabrizo Branca’s work on the subject: http://www.slideshare.net/aoepeople/rock-solid-magento Also check out Joshua Warren’s slides on Test Driven Development and his stem to stern tutorial Rock Solid Magento Development. http://www.slideshare.net/joshuaswarren/
  • 11. "Don't rate potential over performance." - Jim Fassel Blaze Meter Using Blazemeter you can easily build repeatable tests, with very nice graphs. (based on JMeter) Gatling http://gatling.io/ On par with Blazemeter. JMeter Very effective, without having to purchase a SaaS Siege Can be used minimally to simulate some types of load.
  • 12. Vs. HARDWARE • HAProxy: a free fast and reliable solution featuring high availability, load balancing and proxying for TCP and HTTP-based applications. • HAProxy can be used for web servers, database servers, Redis and any other TCP based application. • F5 Hardware load balancers are a standard • Rackspace offers a very easy to use web interface to maintain a hybrid infrastructure • Hardware load balancers offer a turn-key mature solution. SOFTWARE
  • 13. Before you start:  Application is optimized and clean  Development Pipeline in place  Deployment infrastructure is solid  Rigorous testing protocols are in place Get started:  Add a Load Balancer  Proxy Web Traffic to web(n) servers  Cluster Redis using Sentinel / Twemproxy  Add Varnish if application permits  Add MySQL Read servers  Build in auto-scaling and your done
  • 14. Hardware Load Balancer HAProxy Load Balancer Sentinel / twemproxy High Availability MySQL / Percona Master/Slave Single Write / Multiple Read Servers Database Apache / Nginx PHP 5.4 + Multiple Web Servers Varnish Web File Server (NFS / NAS) Redis / Memcache Deployment Tools Monitoring Other Typical Cluster Components
  • 15. Expensive, with many features out of the box that will make for an easy turnkey solution. Using Sentinel and twemproxy wrapped by your load balancer will give you amazing performance out of your Redis cluster. Read servers can be load balanced with Magento. This is easy to achieve, but this doesn’t solve the checkout issue. Defacto software load balancing and High Availability server. This is the most common use for a load balancer, and is a great place to start your setup. • Budget concerns will drive this decision • Hosting Choices will affect availability, costs and toolsets • Start locally with HAProxy and build test clusters using vagrant • HAProxy can still be used, with a hardware load balancer in place.
  • 16. • Simple to Load Balance, most sites start here • Challenges include the following: – Session Management: should be a no brainer if your using redis for sessions – Shared filesystem: Use NFS for media, keep all code local to web servers – Fencing: easily solved with either software or hardware – Log Collection: Rsyslog or Splunk • Keep the system builds simple, repeatable and automate if possible • How to automate: – Create an complete image to work from - include puppet so it can pull from puppetmaster – Puppetmaster spins up your webserver stack – You have your deployment process in place, so tie it into puppet and pull the code • Be prepared to lose nodes, the more you have the more likely failure is • When a node runs amok, you must be prepared to kill it dead
  • 17. “Redis clustering using sentinel is easy to set up. Adding twemproxy allows for a highly scalable Redis cluster and you get auto fail over and a ton of other benefits with this configuration. This arrangement can also remove your Redis single point of failure.” http://aepod.com/clustering-magento-redis-caching-with-sentinel-keepalived-twemproxy-and-twemproxy-agent/ • Sentinel Monitors Redis clusters • twemproxy handles sharding • twemproxy agent monitors sentinel • Very robust when setup, nothing is single threaded, everything is HA and the speed…. • Pretty much transparent to Magento despite the complexity
  • 18. • Percona XtraDB to cluster MySQL • Percona XtraBackup for duplicating and rebuilding nodes • Percona Toolkit to help debug any issues your running into • Difficult to scale Write Servers • Scale out your read servers as needed, but MySQL reads are rarely the bottleneck • Typically Slave server is used for backup and hot swap, NOT clustering. A couple quick tips: • Not all tables in Magento are InnoDB, converting the MyISAM and Memory tables is OK • Usually overtime you will need to be able to kill read servers and refresh (STONITH) • Use your Master server as a read server in the load balancer pool, when you kill all your read servers, it can fall back to master.
  • 19. • Detailed Auto-Scaling will have to wait until LonestarPHP – 3 Hour tutorial, which will include web server auto-scaling using puppet – April 16th 2015 in Dallas • Insert puzzle building analogy joke here: http://www.wikihow.com/Assemble-Jigsaw-Puzzles • Each hosting environment has its own quirks and add on top of that the business logic requirements you will almost always have a unique infrastructure for every client • Build small pieces and work them into the larger picture, you can get a lot of performance with a few minor changes. • Test everything you do, keep detailed notes on the configurations and compare against the previous tests
  • 20. • Mathew Beane <mbeane@robofirm.com> • Twitter: @aepod • Blog: http://aepod.com/ Rate this talk: https://joind.in/13837 (Slides will be available) Thanks to the following: My Family The Magento Community Robofirm Fabrizo Branca (deployments) Thjis Feryn (sentinel) Rackspace

Editor's Notes

  1. Sits on projector while people file in.
  2. Mathew Beane, Director, Systems Engineering at Robofirm Magento Certified developer and part of the Zend Z-Team, where I am contributing to Zend Server PHP developer since 2000, Magento developer since 2009.
  3. Robofirm is a Magento Solutions provider and a Magento Parter focused on Mid-level to Enterprise clients. Based out of New York City, however the bulk of our developers are in Dallas or Minneapolis. We are currently hiring talented Magento developers. Talk with Mike or Ryan after this presentation, they will be the guys heckling me and shooting nerf darts at me.
  4. About magento. Dislike magento because of: EAV, Zend Framework 1?, Too bloated, sites are a mess, may like some other platform
  5. Talk about how sites need to scale because they almost all inevitably grow. This is pretty exciting work to be doing as a developer.
  6. Obviously Magento Mountain Climbers, you can tell by the color of their tents? Anyhow, talk a little about optimization in a moment, we will get to load balances later on and we have already talked about metrics and testing a little, and will be coming back if there is time.
  7. Needs to highlight using metrics to prove performance as you go. Applications will vary, so you need to methodically use metrics to judge performance.
  8. Breaking Points, where you need to adjust first. php-fpm on it's own nodes, proxied by nginx. Varnish / Turpentine NFS becomes bottleneck Redis Clustering pairing twemproxy (nutcracker) with redis is a no-brainer as it multiplexes the redis queries, even if you just put it on the same node as redis is running. and Database Rinse and Repeat
  9. Load balancer Breakout
  10. Fencing is the process of isolating a node of a computer cluster or protecting shared resources when a node appears to be malfunctioning. As the number of nodes go up, so does the likelihood of failure Kill a node.. errant node which might have run amok with cluster resources is simply shot in the head
  11. Scalearc and write-ahead-logging as a solution for single writes