SlideShare a Scribd company logo
1 of 45
Download to read offline
Scaling Drupal on
Amazon Web Services
Tristan Roddis
DrupalCamp Brighton, January 2015
What we created: www.qdl.qa
2
3
4
5
• Several hundred thousand pages
• Tens of terabytes of data
• Requirement for high throughput
• Requirement for high resilience
6
What is Drupal?
7
Let’s scale it!
8
Let’s not scale it like this!
9
Centralised database
10
Centralised filesystem
11
Avoid single point of failure
12
AWS TLAs
• EC2 – Elastic Compute Cloud = virtual servers
• RDS – Relational Database Service = database
• ELB – Elastic Load Balancer = distribute requests
13
Therefore…
14
RDS has easy redundancy
15
So now we have
16
Clustered filesystem: GlusterFS
17
GlusterFS components
• EBS – Elastic Block Storage
= file storage up to 1Tb
• LVM – Logical Volume Manager
= grow and shrink volumes
• Gluster has storage ‘bricks’
• Cluster appears as single mount point
(NFS, Gluster protocol etc.)
18
Distribute servers
• Amazon has different Regions and
Availability Zones
19
Use different Availability Zones
20
I lied…
21
Adding Solr and IIPImage…
22
Additional security
• VPC – Virtual Private Cloud = can create your
own network architecture
• Security Groups = firewall rules
• IAM = Identity and Access Management =
restrict AWS roles
23
Final setup
24
Woah – that’s complicated
25
Server provisioning
• Automate everything!
• Use Ansible (or Chef, Puppet, etc.)
26
“If you have to SSH into your servers,
then your automation has failed.”
— Rich Adams
27
Pets vs cattle
28
“When one of them gets sick, you shoot
'em in the head and replace 'em with a
new one.”
—Randy Bias, CEO of Cloudscaling
Deployment I: Drupal tools
• Drush
• Drush master
• Features
• Strongarm
29
Deployment II
• Use Fabric (or Ansible, Capistrano, etc.)
• @runs_once decorator for e.g. drush commands.
30
Load Test
• Jmeter
• Blitz.io or similar
31
Tune performance
• Tools: Apache Benchmark (ab), Yslow, Google
PageSpeed
• xhprof – remove bottlenecks
• Fix warnings and notices
• Disable database logging
• OpCode cache (Zend Optimizer, APC)
• Minify CSS/JS
• Lazy Loading via AJAX
32
33
Add caching
• Varnish
• Redis/memcached for cache tables (can use
Amazon Elasticache)
• CDN (e.g. Amazon Cloudfront)
• Re-run load tests
34
[auto]scaling
• AMIs = Amazon Machine Image
• Autoscaling policies
• “pets versus cattle” again
• Problem: servers must have latest Drupal code
• Conflict with Fabric 'push‘ technique
• Interim solution: create an AMI after
each deployment
35
Backup
• AMIs - Amazon Machine Image = snapshot
server images
• ELB snapshots
• S3 – Simple Storage Service = REST storage
• Glacier = long-term storage
• We used:
– Snapshots with RDS
– S3 with versioning, plus Glacier for Drupal
assets and image assets
36
Monitoring I: Cloudwatch alerts
37
Monitoring II: log analysis
• SumoLogic to aggregate logs (or Loggly,
Papertrail, etc.)
38
Monitoring III: notifications
• OpsGenie (or PagerDuty or similar)
39
Gotchas
• GlusterFS for PHP files – don’t!
• Custom Drupal cache – careful of
uncontrolled growth!
40
Tips
• Use “termination protection”
• Enable ELB logging
• “Maintenance 200” module
• Create a “down for maintenance” server
41
Conclusion
• 21 instances
• 6 load balancers
• 67 ELB volumes
• Lot of work to set up, but quick to alter
• Easily coped with launch traffic:
– 21k sessions/day
– peak of 350 concurrent users
42
Further Reading
• Justin Slattery, "Multiple Region Autoscaling
Drupal in Amazon Web Services"
http://dev.mlsdigital.net/posts/Cloud-Native-
Drupal/
• Rich Adams, "AWS Tips I Wish I'd Known Before
I Started" https://wblinks.com/notes/aws-tips-i-
wish-id-known-before-i-started/
• Laura Hamilton, "Are your servers pets or
cattle?" http://www.lauradhamilton.com/servers-
pets-versus-cattle
43
www.cogapp.com/careers
Questions?
• tristanr@cogapp.com
45

More Related Content

What's hot

OSOM Operations in the Cloud
OSOM Operations in the CloudOSOM Operations in the Cloud
OSOM Operations in the Cloud
mstuparu
 

What's hot (19)

Scylla Summit 2022: Scylla 5.0 New Features, Part 2
Scylla Summit 2022: Scylla 5.0 New Features, Part 2Scylla Summit 2022: Scylla 5.0 New Features, Part 2
Scylla Summit 2022: Scylla 5.0 New Features, Part 2
 
OSOM - Operations in the Cloud
OSOM - Operations in the CloudOSOM - Operations in the Cloud
OSOM - Operations in the Cloud
 
OSOM Operations in the Cloud
OSOM Operations in the CloudOSOM Operations in the Cloud
OSOM Operations in the Cloud
 
Scylla Summit 2022: How ScyllaDB Powers This Next Tech Cycle
Scylla Summit 2022: How ScyllaDB Powers This Next Tech CycleScylla Summit 2022: How ScyllaDB Powers This Next Tech Cycle
Scylla Summit 2022: How ScyllaDB Powers This Next Tech Cycle
 
Scylla Summit 2022: Scylla 5.0 New Features, Part 1
Scylla Summit 2022: Scylla 5.0 New Features, Part 1Scylla Summit 2022: Scylla 5.0 New Features, Part 1
Scylla Summit 2022: Scylla 5.0 New Features, Part 1
 
Running a DynamoDB-compatible Database on Managed Kubernetes Services
Running a DynamoDB-compatible Database on Managed Kubernetes ServicesRunning a DynamoDB-compatible Database on Managed Kubernetes Services
Running a DynamoDB-compatible Database on Managed Kubernetes Services
 
Critical Attributes for a High-Performance, Low-Latency Database
Critical Attributes for a High-Performance, Low-Latency DatabaseCritical Attributes for a High-Performance, Low-Latency Database
Critical Attributes for a High-Performance, Low-Latency Database
 
How Docker Accelerates Continuous Development at ironSource: Containers #101 ...
How Docker Accelerates Continuous Development at ironSource: Containers #101 ...How Docker Accelerates Continuous Development at ironSource: Containers #101 ...
How Docker Accelerates Continuous Development at ironSource: Containers #101 ...
 
Kubernetes talk at DDDSydney 2017
Kubernetes talk at DDDSydney 2017Kubernetes talk at DDDSydney 2017
Kubernetes talk at DDDSydney 2017
 
Scylla Summit 2022: Stream Processing with ScyllaDB
Scylla Summit 2022: Stream Processing with ScyllaDBScylla Summit 2022: Stream Processing with ScyllaDB
Scylla Summit 2022: Stream Processing with ScyllaDB
 
Scylla Summit 2016: Graph Processing with Titan and Scylla
Scylla Summit 2016: Graph Processing with Titan and ScyllaScylla Summit 2016: Graph Processing with Titan and Scylla
Scylla Summit 2016: Graph Processing with Titan and Scylla
 
Eliminating Volatile Latencies Inside Rakuten’s NoSQL Migration
Eliminating  Volatile Latencies Inside Rakuten’s NoSQL MigrationEliminating  Volatile Latencies Inside Rakuten’s NoSQL Migration
Eliminating Volatile Latencies Inside Rakuten’s NoSQL Migration
 
Server-less solution for moving Millions of Images in Cloud - Brett Sutter, ...
 Server-less solution for moving Millions of Images in Cloud - Brett Sutter, ... Server-less solution for moving Millions of Images in Cloud - Brett Sutter, ...
Server-less solution for moving Millions of Images in Cloud - Brett Sutter, ...
 
AWS Quick Intro
AWS Quick IntroAWS Quick Intro
AWS Quick Intro
 
Amazon Web Services lection 4
Amazon Web Services lection 4  Amazon Web Services lection 4
Amazon Web Services lection 4
 
Managing MySQL Scale Through Consolidation
Managing MySQL Scale Through ConsolidationManaging MySQL Scale Through Consolidation
Managing MySQL Scale Through Consolidation
 
AWS Bulgaria: Re:invent 2017 Recap
AWS Bulgaria: Re:invent 2017 RecapAWS Bulgaria: Re:invent 2017 Recap
AWS Bulgaria: Re:invent 2017 Recap
 
Long running aws lambda - Joel Schuweiler, Minneapolis
Long running aws lambda -  Joel Schuweiler, MinneapolisLong running aws lambda -  Joel Schuweiler, Minneapolis
Long running aws lambda - Joel Schuweiler, Minneapolis
 
Scylla Summit 2022: Building Zeotap's Privacy Compliant Customer Data Platfor...
Scylla Summit 2022: Building Zeotap's Privacy Compliant Customer Data Platfor...Scylla Summit 2022: Building Zeotap's Privacy Compliant Customer Data Platfor...
Scylla Summit 2022: Building Zeotap's Privacy Compliant Customer Data Platfor...
 

Similar to Scaling drupal on amazon web services dr

Training AWS: Module 8 - RDS, Aurora, ElastiCache
Training AWS: Module 8 - RDS, Aurora, ElastiCacheTraining AWS: Module 8 - RDS, Aurora, ElastiCache
Training AWS: Module 8 - RDS, Aurora, ElastiCache
Bùi Quang Lâm
 
Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWSMigrating enterprise workloads to AWS
Migrating enterprise workloads to AWS
Tom Laszewski
 

Similar to Scaling drupal on amazon web services dr (20)

[Jun AWS 201] Technical Workshop
[Jun AWS 201] Technical Workshop[Jun AWS 201] Technical Workshop
[Jun AWS 201] Technical Workshop
 
REDSHIFT - Amazon
REDSHIFT - AmazonREDSHIFT - Amazon
REDSHIFT - Amazon
 
Training AWS: Module 8 - RDS, Aurora, ElastiCache
Training AWS: Module 8 - RDS, Aurora, ElastiCacheTraining AWS: Module 8 - RDS, Aurora, ElastiCache
Training AWS: Module 8 - RDS, Aurora, ElastiCache
 
AWS Lambda at JUST EAT
AWS Lambda at JUST EATAWS Lambda at JUST EAT
AWS Lambda at JUST EAT
 
Scaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million UsersScaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million Users
 
Big data on aws
Big data on awsBig data on aws
Big data on aws
 
Migrating enterprise workloads to AWS
Migrating enterprise workloads to AWSMigrating enterprise workloads to AWS
Migrating enterprise workloads to AWS
 
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
 
What's New on AWS and What it Means to You
What's New on AWS and What it Means to YouWhat's New on AWS and What it Means to You
What's New on AWS and What it Means to You
 
MySQL in the Hosted Cloud
MySQL in the Hosted CloudMySQL in the Hosted Cloud
MySQL in the Hosted Cloud
 
Oracle Solutions on AWS : May 2014
Oracle Solutions on AWS : May 2014Oracle Solutions on AWS : May 2014
Oracle Solutions on AWS : May 2014
 
AWS Analytics
AWS AnalyticsAWS Analytics
AWS Analytics
 
AWS Webcast - Explore the AWS Cloud
AWS Webcast - Explore the AWS CloudAWS Webcast - Explore the AWS Cloud
AWS Webcast - Explore the AWS Cloud
 
Study Notes - Architecting for the cloud (AWS Best Practices, Feb 2016)
Study Notes - Architecting for the cloud (AWS Best Practices, Feb 2016)Study Notes - Architecting for the cloud (AWS Best Practices, Feb 2016)
Study Notes - Architecting for the cloud (AWS Best Practices, Feb 2016)
 
Cloud Architecture: Patterns and Best Practices
Cloud Architecture: Patterns and Best PracticesCloud Architecture: Patterns and Best Practices
Cloud Architecture: Patterns and Best Practices
 
Riga dev day: Lambda architecture at AWS
Riga dev day: Lambda architecture at AWSRiga dev day: Lambda architecture at AWS
Riga dev day: Lambda architecture at AWS
 
Aws best practices
Aws best practicesAws best practices
Aws best practices
 
Backup and archiving in the aws cloud
Backup and archiving in the aws cloudBackup and archiving in the aws cloud
Backup and archiving in the aws cloud
 
AWS Webcast - Attunity Couchsurfing
AWS Webcast - Attunity CouchsurfingAWS Webcast - Attunity Couchsurfing
AWS Webcast - Attunity Couchsurfing
 
Swift at Scale: The IBM SoftLayer Story
Swift at Scale: The IBM SoftLayer StorySwift at Scale: The IBM SoftLayer Story
Swift at Scale: The IBM SoftLayer Story
 

More from Tristan Roddis

QED: Quantum Electrodynamics
QED: Quantum ElectrodynamicsQED: Quantum Electrodynamics
QED: Quantum Electrodynamics
Tristan Roddis
 

More from Tristan Roddis (10)

Making Meaning in a Multilingual World
Making Meaning in a Multilingual WorldMaking Meaning in a Multilingual World
Making Meaning in a Multilingual World
 
Bitish Sea Forts
Bitish Sea FortsBitish Sea Forts
Bitish Sea Forts
 
Linked data at the Science Museum
Linked data at the Science MuseumLinked data at the Science Museum
Linked data at the Science Museum
 
Experiences of CMS selection
Experiences of CMS selectionExperiences of CMS selection
Experiences of CMS selection
 
QED: Quantum Electrodynamics
QED: Quantum ElectrodynamicsQED: Quantum Electrodynamics
QED: Quantum Electrodynamics
 
Writing implements from the future (Livescribe Pulse)
Writing implements from the future (Livescribe Pulse)Writing implements from the future (Livescribe Pulse)
Writing implements from the future (Livescribe Pulse)
 
Introduction to Android development
Introduction to Android developmentIntroduction to Android development
Introduction to Android development
 
Arduino workshop
Arduino workshopArduino workshop
Arduino workshop
 
Introduction to programming AVR microcontrollers
Introduction to programming AVR microcontrollersIntroduction to programming AVR microcontrollers
Introduction to programming AVR microcontrollers
 
QRCodes
QRCodesQRCodes
QRCodes
 

Recently uploaded

原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
ydyuyu
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
pxcywzqs
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
F
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Monica Sydney
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Monica Sydney
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 

Recently uploaded (20)

APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 

Scaling drupal on amazon web services dr