Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment...

33

Transcript of Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment...

Page 1: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring
Page 2: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Chief Technology Officer

George Cagle

Page 3: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Avoiding Traffic Jams: Architecting Scalable Magento Clusters

Page 4: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Standard Magento Environment

Single point of failure that is difficult to scale

Single-server instance housing both web files and site database

Cache and sessions stored on the file-system

Page 5: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Planning for Traffic Spikes

Build resource baseline from average traffic levels

Plan for 10-20% more traffic than expected

Determine if horizontal or vertical expansion is required

Bring resources online and perform stress-testing

Process is time consuming and can be expensive

01

02

03

04

05

Page 6: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Vertical Expansion Options

Increase CPU/RAM resources on server

Split web and database services across two servers

Page 7: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Horizontal Expansion Options

Load balancer distributes traffic evenly across all nodes

Deploy additional web server nodes

Page 8: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Problems with Expansion

No centralized file storage for /media or /var01

02

03

04

Admin Dashboard errors may occur during uploads/imports

Session data must be stored in database adding overhead

Expansion can be expensive, time consuming, and will require downtime

Page 9: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

What About the Unexpected?

Page 10: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Unexpected Traffic SpikesSales, media campaigns, social media trends, etc

Without planning can lead to server overload and lost sales

Page 11: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Unexpected Traffic Spikes

Page 12: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Scalable Architecture to the Rescue!

Page 13: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Scalability Requires a Stateless Environment

A Stateless system keeps no local state/session record

The value of output(s) at any point in time depends only on the value of input(s)

Allows for a virtually unlimited number of new node creations

Data depending on a specific state must be centralized for node access

01

02

03

04

Page 14: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Utilize Stateless Design from Day 1

Provides ability to scale resources vertically and horizontally

Minimize or eliminate downtime

Improve performance

Improve security

Take advantage of load balancing, auto scaling, etc.

01

02

03

04

05

Page 15: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Considerations for Stateless Design

DNS A-record TTL set low to enable fast propagation (or utilize services like CloudFlare)

Session storage in Memcache / Redis

Cache storage in Memcache / Redis / Varnish

CDN for Media access and distribution

Database configured with binary logging for easy replication

Configuration management (Puppet/ Chef / Salt / etc)

01

02

03

04

05

06

Page 16: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster Expansion

• Initial Magento deployment on single-server environment

• Session and Cache data stored on separate daemons

• NFS export created for media and var directories

• Binary logging enabled for database service

• Configurations stores in automation system such as Chef / Puppet / Salt

Page 17: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster Expansion

• Database server config pushed from automation system

• Binary logging used to create a database slave on separate server

• Database slave promoted to master to complete database migration

Page 18: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster Expansion

• Push daemon configuration from automation system to new servers

• Move Session / Cache daemons to individual instances

Page 19: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster Expansion• Utilize low DNS A-record TTL to add a load balancer edge device

• Web Server #1 pulls media and var NFS mounts from admin server

• Cache / Session / Search pulled from centralized daemons

Page 20: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster Expansion

Page 21: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Scalable Architecture in Production

Page 22: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster Elasticity in Action

Page 23: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster Elasticity in Action

Page 24: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster Elasticity in Action

Page 25: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster Elasticity in Action

Page 26: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster Elasticity in Action

Page 27: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster Elasticity in Action

Page 28: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Maximize ROI

Page 29: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster at Peak Utilization – 4 Hours

Without A Scalable Solution:

• $800-1200 per production server• 9 servers in production

• $7,200.00-10,800.00• 3-7 Days For Deployment Prep

Page 30: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster at Peak Utilization – 4 Hours

• $800-1200 per production server• 4 servers in production

• $1.07-1.61 per standby server hour• 5 servers in standby

• $3,221.40-4,832.20• <5 Minutes for Deployment

With A Scalable Solution:

Page 31: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

Magento Cluster at Peak Utilization – 4 Hours

With A Scalable Solution:

• $3,221.40-4,832.20

• <5 Minutes for Deployment

• Savings: $3,978.60 – 5,967.80

Without A Scalable Solution:

• $7200.00-10,800.00

• 3-7 Days For Deployment Prep

Page 32: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

SummaryUse a stateless design model from Day 1

Maximize ROI

Avoid wasting resources and only pay for what you need

01

02

03

04

Scale infrastructure to meet traffic demands

Page 33: Chief Technology Officer - imagine.magento.com IV_Technical... · Standard Magento Environment Single point of failure that is difficult to scale Single-server instance ... Bring

SummaryUse a stateless design model from Day 1

Maximize ROI

Avoid wasting resources and only pay for what you need

01

02

03

04

Scale infrastructure to meet traffic demands