(web304) running and scaling magento on aws | aws re:invent 2014
DESCRIPTION
Magento is a leading open source, eCommerce platform used by many global brands. However, architecting your Magento platform to grow with your business can sometimes be a challenge. This session walks through the steps needed to take an out-of-the-box, single-node Magento implementation and turn it into a highly available, elastic, and robust deployment. This includes an end-to-end caching strategy that provides an efficient front-end cache (including populated shopping carts) using Varnish on Amazon EC2 as well as offloading the Magento caches to separate infrastructure such as Amazon ElastiCache. We also look at strategies to manage the Magento Media library outside of the application instances, including EC2-based shared storage solutions and Amazon S3. At the data layer we look at Magento-specific Amazon RDSandndash;tuning strategies including configuring Magento to use read replicas for horizontal scalability. Finally, we look at proven techniques to manage your Magento implementation at scale, including tips on cache draining, appropriate cache separation, and utilizing AWS CloudFormation to manage your infrastructure and orchestrate predictable deployments.TRANSCRIPT
November 14, 2014 | Las Vegas, NV
Shaun Pearce, Solutions Architect, AWS
Zachary Stevens, Chief Architect, Elastera
40%
40% of shoppers abandon a site that
takes more than 3 seconds to load
Source: blog.kissmetrics.com/loading-time/
79%
79% of shoppers who are dissatisfied with
site performance are less likely to buy from
the same site again
Source: blog.kissmetrics.com/loading-time/
November
SALEENDS SOON
visit example.com/sale
http://youtu.be/xbuiIwEOCAs
Bottleneck
Bottleneck
Magento instance
Master Slave Master Slave Master Slave
Bottleneck
Bottleneck
HTTP cache server (10.0.0.1)
Varnish
Magento
10.0.1.1
10.0.1.2
10.0.1.3Internal
load balancer
Magento
Magento
User External
load balancer
default.vcl
example.us-east-1.elb.amazonaws.com
Varnish
HTTP cache server (10.0.0.1)
10.0.1.1
Magento
Internal
load balancer
User External
load balancer
default.vcl
10.0.1.1
Varnish
HTTP cache server (10.0.0.1)
Magento
Magento
Magento
10.0.2.3
10.0.2.4
10.0.2.5
User External
load balancer
default.vcl
10.0.2.3
10.0.2.4
10.0.2.5
Varnish
HTTP cache server (10.0.0.1)
Magento
Magento
Magento
User External
load balancer
10.0.2.3
10.0.2.4
10.0.2.5
default.vcl
10.0.2.3
10.0.2.4
10.0.2.5
10.0.2.6
HTTP cache server (10.0.0.1)
Varnish Nginx
default.vcl
localhost:8080
User External
load balancer
Magento
10.0.1.1
10.0.1.2
10.0.1.3Internal
load balancer
Magento
Magento
nginx.conf
example.us-
east-
1.elb.amazonaw
s.com
HTTP cache server (10.0.0.1)
Varnish Nginx
default.vcl
localhost:8080
User External
load balancer
Magento
10.0.1.1
10.0.1.2
10.0.1.3Internal
load balancer
Magento
Magento
nginx.conf
example.us-
east-
1.elb.amazonaw
s.com
HTTP cache server (10.0.0.1)
Varnish
default.vcl
localhost:8080
User External
load balancer
Magento
10.0.1.1
10.0.1.2
10.0.1.3
Nginx
Internal
load balancer
Magento
Magento
nginx.conf
example.us-
east-
1.elb.amazonaw
s.com
HTTP cache server (10.0.0.1)
Varnish
default.vcl
localhost:8080
User External
load balancer
Magento
10.0.1.1
10.0.1.2
10.0.1.3
Nginx
Internal
load balancer
Magento
Magento
nginx.conf
example.us-
east-
1.elb.amazonaw
s.com
HTTP cache server (10.0.0.1)
Varnish
default.vcl
localhost:8080
User External
load balancer
Magento
10.0.1.1
10.0.1.2
10.0.1.3
Nginx
Internal
load balancer
Magento
Magento
nginx.conf
example.us-
east-
1.elb.amazonaw
s.com
HTTP cache server (10.0.0.1)
Varnish
default.vcl
localhost:8080
User External
load balancer
Magento
10.0.1.1
10.0.1.2
10.0.1.3
Nginx
Internal
load balancer
Magento
Magento
nginx.conf
example.us-
east-
1.elb.amazonaw
s.com
HTTP cache server (10.0.0.1)
Varnish
default.vcl
localhost:8080
User External
load balancer
Magento
10.0.1.1
10.0.1.2
10.0.1.3
Nginx
Internal
load balancer
Magento
Magento
nginx.conf
example.us-
east-
1.elb.amazonaw
s.com
HTTP cache server (10.0.0.1)
Varnish
default.vcl
localhost:8080
User External
load balancer
Magento
10.0.1.1
10.0.1.2
10.0.1.3
Nginx
Internal
load balancer
Magento
Magento
nginx.conf
example.us-
east-
1.elb.amazonaw
s.com
HTTP cache server (10.0.0.1)
Varnish
default.vcl
localhost:8080
User External
load balancer
Magento
10.0.1.1
10.0.1.2
10.0.1.3
Nginx
Internal
load balancer
Magento
Magento
nginx.conf
example.us-
east-
1.elb.amazonaw
s.com
HTTP cache server (10.0.0.1)
Varnish
default.vcl
localhost:8080
User External
load balancer
Magento
10.0.1.1
10.0.1.2
10.0.1.3
Nginx
Internal
load balancer
Magento
Magento
nginx.conf
example.us-
east-
1.elb.amazonaw
s.com
SaaS BEST OF BOTH DIY
No headaches
Predictable cost
Lower TCOHeadaches
Spiraling cost
High TCO
Renting
Constraints
Ownership
Freedom
Ownership
Freedom
Less headaches
Lower Cost
RUN
MANAGE
EVOLVE
Availability Zone Availability Zone
Magento Admin Primary Read Rep
Auto Scaling groupMagento MagentoMagento Magento MagentoMagento Media
CDN
Static
CDN
Media
S3
Magento Admin
Primary
CloudFront Amazon S3
Auto Scaling group
Magento MagentoMagento
Magento Admin
Primary
CloudFront Amazon S3
Auto Scaling group
Magento MagentoMagento
Magento Admin
Primary
CloudFront Amazon S3
Auto Scaling group
Magento MagentoMagento
Magento Admin
Primary
CloudFront Amazon S3
Auto Scaling group
Magento MagentoMagento
Magento Admin
Primary
CloudFront Amazon S3
Auto Scaling group
Magento MagentoMagento
Magento Admin
Primary
CloudFront Amazon S3
Auto Scaling group
Magento MagentoMagento
QUALITY from code
log_bin_trust_function_creators
• local.xmlConfiguration
• Magento codeWebsite
• Apache, PHP
• Chef, NewRelic
System software
• Amazon LinuxBase OS
• local.xmlConfiguration
• Magento codeWebsite
• Apache, PHP
• Chef, NewRelic
System software
• Amazon LinuxBase OS
PROACTIVELY
• local.xmlConfiguration
• Magento codeWebsite
• Apache, PHP
• Chef, NewRelic
System software
• Amazon LinuxBase OS
• local.xmlConfiguration
• Magento codeWebsite
• Apache, PHP
• Chef, NewRelic
System software
• Amazon LinuxBase OS
Magento Admin
Auto Scaling group
Magento Magento Magento Admin
Auto Scaling group
Magento Magento
Live
Deploy
server
Staging
Developer Deploy
bucket
Magento Admin
Auto Scaling group
Magento Magento Magento Admin
Auto Scaling group
Magento Magento
Live
Deploy
server
Staging
Developer Deploy
bucket
Magento Admin
Auto Scaling group
Magento Magento Magento Admin
Auto Scaling group
Magento Magento
Live
Deploy
server
Staging
Developer Deploy
bucket
PUSH
where are you
Magento Admin
Auto Scaling group
Magento Magento
Deploy
bucket
Live
Deploy
server
Magento Admin
Auto Scaling group
Magento Magento
Staging
Developer
Magento Admin
Auto Scaling group
Magento Magento
Deploy
bucket
Live
Deploy
serverDeveloper
Magento Admin
Auto Scaling group
Magento Magento
Staging
UPGRADE
Magento Admin
Auto Scaling group
Magento Magento
Deploy
bucket
Live
Deploy
serverDeveloper
Magento Admin
Auto Scaling group
Magento Magento
Staging
Magento Admin
Auto Scaling group
Magento Magento
Deploy
bucket
Live
Deploy
serverDeveloper
Magento Admin
Auto Scaling group
Magento Magento
Staging
Note
Magento Admin
Auto Scaling group
Magento Magento
Deploy
bucket
Live
Deploy
serverDeveloper
Magento Admin
Auto Scaling group
Magento Magento
Staging
Magento Admin
Auto Scaling group
Magento Magento
Deploy
bucket
Live
Deploy
serverDeveloper
Magento Admin
Auto Scaling group
Magento Magento
Staging
http://bit.ly/awsevals