SlideShare a Scribd company logo
About Me
Academics
Computer Science Engineer - UCA
Masters Degree on Software Engineering - US
Masters Degree on IT Security - US
Experience
5+ years as web developer, 3 of them using Drupal
Currently: Freelance DevOps
IT Security, GNU/Linux, Python, Node.JS . . .
Interests
Rock’n’Roll (electric guitar) and videogames
Books, movies, beer, whiskey, roleplaying. . .
Zequi V´azquez Drupal Extreme Scaling
Contents
1 Introduction
2 The Project
3 Problems and Solutions
4 Demo
5 Conclusions
Zequi V´azquez Drupal Extreme Scaling
Contents
1 Introduction
2 The Project
3 Problems and Solutions
4 Demo
5 Conclusions
Zequi V´azquez Drupal Extreme Scaling
Introduction
How does Drupal scale?
What is scaling?
Related to performance,
but it’s not the same
Horizontal scaling
Vertical scaling
Drupal is highly
cache-dependent
Zequi V´azquez Drupal Extreme Scaling
Introduction
Drupal performance, scalabilty & availability
Memcache
Apc / Opcache
Varnish
Redundancy
Choose your cache improvement module
Zequi V´azquez Drupal Extreme Scaling
Introduction
Cloud computing and containers
Elastic computing → resources grow on demand
In theory, we achieve full scalability and availability. False!
The hidden enemy: budget grows till infinity and beyond
Containers (Docker) → Only for local environments?
Zequi V´azquez Drupal Extreme Scaling
Contents
1 Introduction
2 The Project
3 Problems and Solutions
4 Demo
5 Conclusions
Zequi V´azquez Drupal Extreme Scaling
The Project
Some base requirements
Built in Drupal 7, as a multisite install
Currently, +30k sites. It needs to scale up to +100k sites
Availability close to 99.999 %
Of course, high performance at lowest possible cost
Need to control site creation from external app
Automated and not-disruptive deployments
Ability to execute drush commands on all sites
Migration from previous platform
Three devs only - frontend, backend and devops
Zequi V´azquez Drupal Extreme Scaling
What??
Zequi V´azquez Drupal Extreme Scaling
Desperate times . . .
Seems scary, uh?
Usual technologies are not
enough to tackle project
We are “computer
sciencists”, aren’t we?
God bless Open Source
Stairway to heaven cloud
Docker is more than local
Zequi V´azquez Drupal Extreme Scaling
. . . funny times!
Zequi V´azquez Drupal Extreme Scaling
The Webserver
Drupal over Nginx and PHP-fpm
Nginx allow a real very flexible configuration
PHP fpm increases performance significantly
We use DynamoDB to identify existent sites
Mod Security with custom rules for Drupal - soon!
Zequi V´azquez Drupal Extreme Scaling
The Node.JS app
Manage sites on a multisite Drupal
Asynchronous: execute something, and forget about it
Use DynamoDB to store a list of deployed sites
API to allow batch operations on sites list
Zequi V´azquez Drupal Extreme Scaling
The Container
Stateless Drupal container
Memcache, MySQL, MongoDB as external services
S3fs module → all files on S3
Emails sent through PostMark
Monitorization using NewRelic
Zequi V´azquez Drupal Extreme Scaling
The Cluster
Apache Mesos and Marathon
Mesos abstracts the resources and creates a cluster
Two masters orchestrated by Zookeeper, one or more workers
Marathon allows to run Docker containers
Chronos allows to run cron jobs
Rest API to manage apps and containers
Zequi V´azquez Drupal Extreme Scaling
The AutoScaling Group
Mesos over AWS
EC2 image for autoscaling from Mesos main worker
AMI contains all 3 Docker images
Main worker has Node.JS app and Varnish
Script to sync amount of Marathon apps with workers number
Zequi V´azquez Drupal Extreme Scaling
The Deployments
And automatization for all . . .
Lazy DevOps is best DevOps
Ansible let us manage AWS in a simple (and powerful!) way
Makefile + Dockerfile = Over 9000!
Create and destroy environments with a single command
Zequi V´azquez Drupal Extreme Scaling
Other stuff
Devil is on details
AWS do backups, but do not use default settings!
Security groups for EC2 → external and internal firewall
Remember to use protection → Http Auth for all Rest APIs
Log centralization is a must → All hail Mesos!
All of this does not matter without a recovery plan
Zequi V´azquez Drupal Extreme Scaling
Contents
1 Introduction
2 The Project
3 Problems and Solutions
4 Demo
5 Conclusions
Zequi V´azquez Drupal Extreme Scaling
The Database(s)
So you think 30k sites are too much
30k sites on a Drupal multisite means 30k databases
MySQL → 1 folder per database, 1 file per table
MongoDB preallocates files when a database is created
Conclusion? Unmanageable
Zequi V´azquez Drupal Extreme Scaling
The Database(s)
Divide and conquer!
Identify each site using a unique hash
Use that hash as prefix for tables on MySQL and MongoDB
Group 500 sites per database, both MongoDB and MySQL
MongoDB maximum database size is 3.952GB
MySQL number of tables per database is 62k aprox.
Zequi V´azquez Drupal Extreme Scaling
The Way Of The Request
Never seen a settings.php file with steroids?
Connect to DynamoDB
Identify domain from the request
(both drush and http)
Calculate domain unique hash
Ask DynamoDB for the database
where the site lives
Make sure hash is used as prefix
Zequi V´azquez Drupal Extreme Scaling
The Site Creation Timeout
In soviet Russia, Nginx configures you
Happened when Node.JS app launched a site creation
Strange timeout error made us configure Nginx deeply
Fire and forget. When site was created, app is notified
Further investigation → timeout produced on Haproxy
Zequi V´azquez Drupal Extreme Scaling
Other problems found
Another brick in the wall
Unstability on autoscaling group
MongoDB MMS instances out of space
PHP-fpm unstability → slowlog
Thousand S3 buckets? God bless S3fs
Remote & massive Drush
Migration: 30k sites on few days
AWS RDS speed: the bigger, the better
Zequi V´azquez Drupal Extreme Scaling
Contents
1 Introduction
2 The Project
3 Problems and Solutions
4 Demo
5 Conclusions
Zequi V´azquez Drupal Extreme Scaling
Please, do not pull your arms out of the window
Demo time!
Zequi V´azquez Drupal Extreme Scaling
Contents
1 Introduction
2 The Project
3 Problems and Solutions
4 Demo
5 Conclusions
Zequi V´azquez Drupal Extreme Scaling
Conclusions
Spoiler alert!
Project went live on April 2015. Absolute success!
Learned a lot about new technologies
Cloud + Containers = Profit
Drupal flexibility is amazing
Zequi V´azquez Drupal Extreme Scaling
Be sure to practice first, Frodo
Zequi V´azquez Drupal Extreme Scaling
That’s all, folks!
Thank you!
@RabbitLair
ezequielvazq[at]gmail[dot]com
Zequi V´azquez Drupal Extreme Scaling

More Related Content

What's hot

Ceph, Xen, and CloudStack: Semper Melior
Ceph, Xen, and CloudStack: Semper MeliorCeph, Xen, and CloudStack: Semper Melior
Ceph, Xen, and CloudStack: Semper Melior
Patrick McGarry
 
Ceph & OpenStack - Boston Meetup
Ceph & OpenStack - Boston MeetupCeph & OpenStack - Boston Meetup
Ceph & OpenStack - Boston Meetup
Patrick McGarry
 
Implementing blue-green deployment with Atlassian Bamboo
Implementing blue-green deployment with Atlassian BambooImplementing blue-green deployment with Atlassian Bamboo
Implementing blue-green deployment with Atlassian Bamboo
Dave Clark
 
1 Million Writes per second on 60 nodes with Cassandra and EBS
1 Million Writes per second on 60 nodes with Cassandra and EBS1 Million Writes per second on 60 nodes with Cassandra and EBS
1 Million Writes per second on 60 nodes with Cassandra and EBS
Jim Plush
 
deep learning in production cff 2017
deep learning in production cff 2017deep learning in production cff 2017
deep learning in production cff 2017
Ari Kamlani
 
Luciano Fiandesio - Docker 101 | Codemotion Milan 2015
Luciano Fiandesio - Docker 101 | Codemotion Milan 2015Luciano Fiandesio - Docker 101 | Codemotion Milan 2015
Luciano Fiandesio - Docker 101 | Codemotion Milan 2015
Codemotion
 
Dcamp ldn presentation
Dcamp ldn presentationDcamp ldn presentation
Dcamp ldn presentationa_c_m
 
Serverless Presentation from Devoxx 2017 Casablanca (AWS Lambda / FaaS / Fn ...
Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn ...Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn ...
Serverless Presentation from Devoxx 2017 Casablanca (AWS Lambda / FaaS / Fn ...
Frank Munz
 
Reuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless WorldReuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless World
Dmitri Zimine
 
Deep Learning을 위한 AWS 기반 인공 지능(AI) 서비스 (윤석찬)
Deep Learning을 위한  AWS 기반 인공 지능(AI) 서비스 (윤석찬)Deep Learning을 위한  AWS 기반 인공 지능(AI) 서비스 (윤석찬)
Deep Learning을 위한 AWS 기반 인공 지능(AI) 서비스 (윤석찬)
Amazon Web Services Korea
 
How to build an HA container orchestrator infrastructure for production – Giu...
How to build an HA container orchestrator infrastructure for production – Giu...How to build an HA container orchestrator infrastructure for production – Giu...
How to build an HA container orchestrator infrastructure for production – Giu...
Codemotion
 
TIAD : Automating the modern datacenter
TIAD : Automating the modern datacenterTIAD : Automating the modern datacenter
TIAD : Automating the modern datacenter
The Incredible Automation Day
 
CloudStack, jclouds and Whirr!
CloudStack, jclouds and Whirr!CloudStack, jclouds and Whirr!
CloudStack, jclouds and Whirr!
Andrew Bayer
 
TIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by stepTIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by step
The Incredible Automation Day
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
Pablo Godel
 
High order bits from cassandra & hadoop
High order bits from cassandra & hadoopHigh order bits from cassandra & hadoop
High order bits from cassandra & hadoopsrisatish ambati
 
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
Docker, Inc.
 
Austin Web Architecture
Austin Web ArchitectureAustin Web Architecture
Austin Web Architecture
joaquincasares
 
TIAD : Automating the aplication lifecycle
TIAD : Automating the aplication lifecycleTIAD : Automating the aplication lifecycle
TIAD : Automating the aplication lifecycle
The Incredible Automation Day
 
Big data
Big dataBig data
Big data
Kevin Cawley
 

What's hot (20)

Ceph, Xen, and CloudStack: Semper Melior
Ceph, Xen, and CloudStack: Semper MeliorCeph, Xen, and CloudStack: Semper Melior
Ceph, Xen, and CloudStack: Semper Melior
 
Ceph & OpenStack - Boston Meetup
Ceph & OpenStack - Boston MeetupCeph & OpenStack - Boston Meetup
Ceph & OpenStack - Boston Meetup
 
Implementing blue-green deployment with Atlassian Bamboo
Implementing blue-green deployment with Atlassian BambooImplementing blue-green deployment with Atlassian Bamboo
Implementing blue-green deployment with Atlassian Bamboo
 
1 Million Writes per second on 60 nodes with Cassandra and EBS
1 Million Writes per second on 60 nodes with Cassandra and EBS1 Million Writes per second on 60 nodes with Cassandra and EBS
1 Million Writes per second on 60 nodes with Cassandra and EBS
 
deep learning in production cff 2017
deep learning in production cff 2017deep learning in production cff 2017
deep learning in production cff 2017
 
Luciano Fiandesio - Docker 101 | Codemotion Milan 2015
Luciano Fiandesio - Docker 101 | Codemotion Milan 2015Luciano Fiandesio - Docker 101 | Codemotion Milan 2015
Luciano Fiandesio - Docker 101 | Codemotion Milan 2015
 
Dcamp ldn presentation
Dcamp ldn presentationDcamp ldn presentation
Dcamp ldn presentation
 
Serverless Presentation from Devoxx 2017 Casablanca (AWS Lambda / FaaS / Fn ...
Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn ...Serverless Presentation from Devoxx 2017 Casablanca  (AWS Lambda / FaaS / Fn ...
Serverless Presentation from Devoxx 2017 Casablanca (AWS Lambda / FaaS / Fn ...
 
Reuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless WorldReuse, Reduce, Recycle in Serverless World
Reuse, Reduce, Recycle in Serverless World
 
Deep Learning을 위한 AWS 기반 인공 지능(AI) 서비스 (윤석찬)
Deep Learning을 위한  AWS 기반 인공 지능(AI) 서비스 (윤석찬)Deep Learning을 위한  AWS 기반 인공 지능(AI) 서비스 (윤석찬)
Deep Learning을 위한 AWS 기반 인공 지능(AI) 서비스 (윤석찬)
 
How to build an HA container orchestrator infrastructure for production – Giu...
How to build an HA container orchestrator infrastructure for production – Giu...How to build an HA container orchestrator infrastructure for production – Giu...
How to build an HA container orchestrator infrastructure for production – Giu...
 
TIAD : Automating the modern datacenter
TIAD : Automating the modern datacenterTIAD : Automating the modern datacenter
TIAD : Automating the modern datacenter
 
CloudStack, jclouds and Whirr!
CloudStack, jclouds and Whirr!CloudStack, jclouds and Whirr!
CloudStack, jclouds and Whirr!
 
TIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by stepTIAD - DYI: A simple orchestrator built step by step
TIAD - DYI: A simple orchestrator built step by step
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
 
High order bits from cassandra & hadoop
High order bits from cassandra & hadoopHigh order bits from cassandra & hadoop
High order bits from cassandra & hadoop
 
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
 
Austin Web Architecture
Austin Web ArchitectureAustin Web Architecture
Austin Web Architecture
 
TIAD : Automating the aplication lifecycle
TIAD : Automating the aplication lifecycleTIAD : Automating the aplication lifecycle
TIAD : Automating the aplication lifecycle
 
Big data
Big dataBig data
Big data
 

Similar to Drupal Extreme Scaling

Cloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 SlidesCloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 Slides
Ryan Koop
 
Cloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentationsCloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentations
CloudCamp Chicago
 
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
Adeesh Fulay
 
Oracle WebLogic Server 12c with Docker
Oracle WebLogic Server 12c with DockerOracle WebLogic Server 12c with Docker
Oracle WebLogic Server 12c with Docker
Guatemala User Group
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
Michael Lange
 
Docker experience @inbotapp
Docker experience @inbotappDocker experience @inbotapp
Docker experience @inbotapp
Jilles van Gurp
 
Webinar Docker Tri Series
Webinar Docker Tri SeriesWebinar Docker Tri Series
Webinar Docker Tri Series
Newt Global Consulting LLC
 
Experiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamExperiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure team
Brian Benz
 
Extending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with KubernetesExtending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with Kubernetes
Nicola Ferraro
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Carlos Badenes-Olmedo
 
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with Docker
Jérôme Petazzoni
 
Class 7: Introduction to web technology entrepreneurship
Class 7: Introduction to web technology entrepreneurshipClass 7: Introduction to web technology entrepreneurship
Class 7: Introduction to web technology entrepreneurshipallanchao
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Jeffrey Ellin
 
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
Codemotion
 
Nodejs overview
Nodejs overviewNodejs overview
Nodejs overview
Nicola Del Gobbo
 
Drupal PT Meetup Lisbon (December 2011)
Drupal PT Meetup Lisbon (December 2011)Drupal PT Meetup Lisbon (December 2011)
Drupal PT Meetup Lisbon (December 2011)
Paulo Gomes
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small business
Docker-Hanoi
 
Super powered Drupal development with docker
Super powered Drupal development with dockerSuper powered Drupal development with docker
Super powered Drupal development with docker
Maciej Lukianski
 
Cloud Driven Development: a better workflow, less worries, and more power
Cloud Driven Development: a better workflow, less worries, and more powerCloud Driven Development: a better workflow, less worries, and more power
Cloud Driven Development: a better workflow, less worries, and more power
Marzee Labs
 
Confoo - Javascript Server Side : How to start
Confoo - Javascript Server Side : How to startConfoo - Javascript Server Side : How to start
Confoo - Javascript Server Side : How to start
Quentin Adam
 

Similar to Drupal Extreme Scaling (20)

Cloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 SlidesCloud Camp Chicago Dec 2012 Slides
Cloud Camp Chicago Dec 2012 Slides
 
Cloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentationsCloud Camp Chicago Dec 2012 - All presentations
Cloud Camp Chicago Dec 2012 - All presentations
 
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
 
Oracle WebLogic Server 12c with Docker
Oracle WebLogic Server 12c with DockerOracle WebLogic Server 12c with Docker
Oracle WebLogic Server 12c with Docker
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
 
Docker experience @inbotapp
Docker experience @inbotappDocker experience @inbotapp
Docker experience @inbotapp
 
Webinar Docker Tri Series
Webinar Docker Tri SeriesWebinar Docker Tri Series
Webinar Docker Tri Series
 
Experiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamExperiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure team
 
Extending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with KubernetesExtending DevOps to Big Data Applications with Kubernetes
Extending DevOps to Big Data Applications with Kubernetes
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with Docker
 
Class 7: Introduction to web technology entrepreneurship
Class 7: Introduction to web technology entrepreneurshipClass 7: Introduction to web technology entrepreneurship
Class 7: Introduction to web technology entrepreneurship
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
Container orchestration: the cold war - Giulio De Donato - Codemotion Rome 2017
 
Nodejs overview
Nodejs overviewNodejs overview
Nodejs overview
 
Drupal PT Meetup Lisbon (December 2011)
Drupal PT Meetup Lisbon (December 2011)Drupal PT Meetup Lisbon (December 2011)
Drupal PT Meetup Lisbon (December 2011)
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small business
 
Super powered Drupal development with docker
Super powered Drupal development with dockerSuper powered Drupal development with docker
Super powered Drupal development with docker
 
Cloud Driven Development: a better workflow, less worries, and more power
Cloud Driven Development: a better workflow, less worries, and more powerCloud Driven Development: a better workflow, less worries, and more power
Cloud Driven Development: a better workflow, less worries, and more power
 
Confoo - Javascript Server Side : How to start
Confoo - Javascript Server Side : How to startConfoo - Javascript Server Side : How to start
Confoo - Javascript Server Side : How to start
 

More from zekivazquez

Drupal Dev Days 2018 - Autopsy of Vulnerabilities
Drupal Dev Days 2018 - Autopsy of VulnerabilitiesDrupal Dev Days 2018 - Autopsy of Vulnerabilities
Drupal Dev Days 2018 - Autopsy of Vulnerabilities
zekivazquez
 
DrupalCamp Spain 2018: CSI, autopsia de vulnerabilidades
DrupalCamp Spain 2018: CSI, autopsia de vulnerabilidadesDrupalCamp Spain 2018: CSI, autopsia de vulnerabilidades
DrupalCamp Spain 2018: CSI, autopsia de vulnerabilidades
zekivazquez
 
Hacking a sistemas CMS
Hacking a sistemas CMSHacking a sistemas CMS
Hacking a sistemas CMS
zekivazquez
 
Security for Human Beings
Security for Human BeingsSecurity for Human Beings
Security for Human Beings
zekivazquez
 
Information is Power
Information is PowerInformation is Power
Information is Power
zekivazquez
 
Hackea tu propia Harley
Hackea tu propia HarleyHackea tu propia Harley
Hackea tu propia Harley
zekivazquez
 
Seguridad para todos
Seguridad para todosSeguridad para todos
Seguridad para todos
zekivazquez
 
Hack & Beers - Seguridad en Drupal
Hack & Beers - Seguridad en DrupalHack & Beers - Seguridad en Drupal
Hack & Beers - Seguridad en Drupal
zekivazquez
 
Hacking & Hardening Drupal
Hacking & Hardening DrupalHacking & Hardening Drupal
Hacking & Hardening Drupal
zekivazquez
 
Hacking Drupal - Anatomía de una auditoría de seguridad
Hacking Drupal - Anatomía de una auditoría de seguridadHacking Drupal - Anatomía de una auditoría de seguridad
Hacking Drupal - Anatomía de una auditoría de seguridad
zekivazquez
 
Taller Drupal - Jornadas Software Libre UCA
Taller Drupal - Jornadas Software Libre UCATaller Drupal - Jornadas Software Libre UCA
Taller Drupal - Jornadas Software Libre UCA
zekivazquez
 
Desarrollo Seguro en Drupal - DrupalCamp Spain 2013
Desarrollo Seguro en Drupal - DrupalCamp Spain 2013Desarrollo Seguro en Drupal - DrupalCamp Spain 2013
Desarrollo Seguro en Drupal - DrupalCamp Spain 2013
zekivazquez
 
Betabeers Sevilla - Hacking web con OWASP
Betabeers Sevilla - Hacking web con OWASPBetabeers Sevilla - Hacking web con OWASP
Betabeers Sevilla - Hacking web con OWASP
zekivazquez
 
Hacking web con OWASP
Hacking web con OWASPHacking web con OWASP
Hacking web con OWASP
zekivazquez
 

More from zekivazquez (14)

Drupal Dev Days 2018 - Autopsy of Vulnerabilities
Drupal Dev Days 2018 - Autopsy of VulnerabilitiesDrupal Dev Days 2018 - Autopsy of Vulnerabilities
Drupal Dev Days 2018 - Autopsy of Vulnerabilities
 
DrupalCamp Spain 2018: CSI, autopsia de vulnerabilidades
DrupalCamp Spain 2018: CSI, autopsia de vulnerabilidadesDrupalCamp Spain 2018: CSI, autopsia de vulnerabilidades
DrupalCamp Spain 2018: CSI, autopsia de vulnerabilidades
 
Hacking a sistemas CMS
Hacking a sistemas CMSHacking a sistemas CMS
Hacking a sistemas CMS
 
Security for Human Beings
Security for Human BeingsSecurity for Human Beings
Security for Human Beings
 
Information is Power
Information is PowerInformation is Power
Information is Power
 
Hackea tu propia Harley
Hackea tu propia HarleyHackea tu propia Harley
Hackea tu propia Harley
 
Seguridad para todos
Seguridad para todosSeguridad para todos
Seguridad para todos
 
Hack & Beers - Seguridad en Drupal
Hack & Beers - Seguridad en DrupalHack & Beers - Seguridad en Drupal
Hack & Beers - Seguridad en Drupal
 
Hacking & Hardening Drupal
Hacking & Hardening DrupalHacking & Hardening Drupal
Hacking & Hardening Drupal
 
Hacking Drupal - Anatomía de una auditoría de seguridad
Hacking Drupal - Anatomía de una auditoría de seguridadHacking Drupal - Anatomía de una auditoría de seguridad
Hacking Drupal - Anatomía de una auditoría de seguridad
 
Taller Drupal - Jornadas Software Libre UCA
Taller Drupal - Jornadas Software Libre UCATaller Drupal - Jornadas Software Libre UCA
Taller Drupal - Jornadas Software Libre UCA
 
Desarrollo Seguro en Drupal - DrupalCamp Spain 2013
Desarrollo Seguro en Drupal - DrupalCamp Spain 2013Desarrollo Seguro en Drupal - DrupalCamp Spain 2013
Desarrollo Seguro en Drupal - DrupalCamp Spain 2013
 
Betabeers Sevilla - Hacking web con OWASP
Betabeers Sevilla - Hacking web con OWASPBetabeers Sevilla - Hacking web con OWASP
Betabeers Sevilla - Hacking web con OWASP
 
Hacking web con OWASP
Hacking web con OWASPHacking web con OWASP
Hacking web con OWASP
 

Recently uploaded

Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 

Recently uploaded (20)

Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 

Drupal Extreme Scaling

  • 1.
  • 2. About Me Academics Computer Science Engineer - UCA Masters Degree on Software Engineering - US Masters Degree on IT Security - US Experience 5+ years as web developer, 3 of them using Drupal Currently: Freelance DevOps IT Security, GNU/Linux, Python, Node.JS . . . Interests Rock’n’Roll (electric guitar) and videogames Books, movies, beer, whiskey, roleplaying. . . Zequi V´azquez Drupal Extreme Scaling
  • 3. Contents 1 Introduction 2 The Project 3 Problems and Solutions 4 Demo 5 Conclusions Zequi V´azquez Drupal Extreme Scaling
  • 4. Contents 1 Introduction 2 The Project 3 Problems and Solutions 4 Demo 5 Conclusions Zequi V´azquez Drupal Extreme Scaling
  • 5. Introduction How does Drupal scale? What is scaling? Related to performance, but it’s not the same Horizontal scaling Vertical scaling Drupal is highly cache-dependent Zequi V´azquez Drupal Extreme Scaling
  • 6. Introduction Drupal performance, scalabilty & availability Memcache Apc / Opcache Varnish Redundancy Choose your cache improvement module Zequi V´azquez Drupal Extreme Scaling
  • 7. Introduction Cloud computing and containers Elastic computing → resources grow on demand In theory, we achieve full scalability and availability. False! The hidden enemy: budget grows till infinity and beyond Containers (Docker) → Only for local environments? Zequi V´azquez Drupal Extreme Scaling
  • 8. Contents 1 Introduction 2 The Project 3 Problems and Solutions 4 Demo 5 Conclusions Zequi V´azquez Drupal Extreme Scaling
  • 9. The Project Some base requirements Built in Drupal 7, as a multisite install Currently, +30k sites. It needs to scale up to +100k sites Availability close to 99.999 % Of course, high performance at lowest possible cost Need to control site creation from external app Automated and not-disruptive deployments Ability to execute drush commands on all sites Migration from previous platform Three devs only - frontend, backend and devops Zequi V´azquez Drupal Extreme Scaling
  • 10. What?? Zequi V´azquez Drupal Extreme Scaling
  • 11. Desperate times . . . Seems scary, uh? Usual technologies are not enough to tackle project We are “computer sciencists”, aren’t we? God bless Open Source Stairway to heaven cloud Docker is more than local Zequi V´azquez Drupal Extreme Scaling
  • 12. . . . funny times! Zequi V´azquez Drupal Extreme Scaling
  • 13. The Webserver Drupal over Nginx and PHP-fpm Nginx allow a real very flexible configuration PHP fpm increases performance significantly We use DynamoDB to identify existent sites Mod Security with custom rules for Drupal - soon! Zequi V´azquez Drupal Extreme Scaling
  • 14. The Node.JS app Manage sites on a multisite Drupal Asynchronous: execute something, and forget about it Use DynamoDB to store a list of deployed sites API to allow batch operations on sites list Zequi V´azquez Drupal Extreme Scaling
  • 15. The Container Stateless Drupal container Memcache, MySQL, MongoDB as external services S3fs module → all files on S3 Emails sent through PostMark Monitorization using NewRelic Zequi V´azquez Drupal Extreme Scaling
  • 16. The Cluster Apache Mesos and Marathon Mesos abstracts the resources and creates a cluster Two masters orchestrated by Zookeeper, one or more workers Marathon allows to run Docker containers Chronos allows to run cron jobs Rest API to manage apps and containers Zequi V´azquez Drupal Extreme Scaling
  • 17. The AutoScaling Group Mesos over AWS EC2 image for autoscaling from Mesos main worker AMI contains all 3 Docker images Main worker has Node.JS app and Varnish Script to sync amount of Marathon apps with workers number Zequi V´azquez Drupal Extreme Scaling
  • 18. The Deployments And automatization for all . . . Lazy DevOps is best DevOps Ansible let us manage AWS in a simple (and powerful!) way Makefile + Dockerfile = Over 9000! Create and destroy environments with a single command Zequi V´azquez Drupal Extreme Scaling
  • 19. Other stuff Devil is on details AWS do backups, but do not use default settings! Security groups for EC2 → external and internal firewall Remember to use protection → Http Auth for all Rest APIs Log centralization is a must → All hail Mesos! All of this does not matter without a recovery plan Zequi V´azquez Drupal Extreme Scaling
  • 20. Contents 1 Introduction 2 The Project 3 Problems and Solutions 4 Demo 5 Conclusions Zequi V´azquez Drupal Extreme Scaling
  • 21. The Database(s) So you think 30k sites are too much 30k sites on a Drupal multisite means 30k databases MySQL → 1 folder per database, 1 file per table MongoDB preallocates files when a database is created Conclusion? Unmanageable Zequi V´azquez Drupal Extreme Scaling
  • 22. The Database(s) Divide and conquer! Identify each site using a unique hash Use that hash as prefix for tables on MySQL and MongoDB Group 500 sites per database, both MongoDB and MySQL MongoDB maximum database size is 3.952GB MySQL number of tables per database is 62k aprox. Zequi V´azquez Drupal Extreme Scaling
  • 23. The Way Of The Request Never seen a settings.php file with steroids? Connect to DynamoDB Identify domain from the request (both drush and http) Calculate domain unique hash Ask DynamoDB for the database where the site lives Make sure hash is used as prefix Zequi V´azquez Drupal Extreme Scaling
  • 24. The Site Creation Timeout In soviet Russia, Nginx configures you Happened when Node.JS app launched a site creation Strange timeout error made us configure Nginx deeply Fire and forget. When site was created, app is notified Further investigation → timeout produced on Haproxy Zequi V´azquez Drupal Extreme Scaling
  • 25. Other problems found Another brick in the wall Unstability on autoscaling group MongoDB MMS instances out of space PHP-fpm unstability → slowlog Thousand S3 buckets? God bless S3fs Remote & massive Drush Migration: 30k sites on few days AWS RDS speed: the bigger, the better Zequi V´azquez Drupal Extreme Scaling
  • 26. Contents 1 Introduction 2 The Project 3 Problems and Solutions 4 Demo 5 Conclusions Zequi V´azquez Drupal Extreme Scaling
  • 27. Please, do not pull your arms out of the window Demo time! Zequi V´azquez Drupal Extreme Scaling
  • 28. Contents 1 Introduction 2 The Project 3 Problems and Solutions 4 Demo 5 Conclusions Zequi V´azquez Drupal Extreme Scaling
  • 29. Conclusions Spoiler alert! Project went live on April 2015. Absolute success! Learned a lot about new technologies Cloud + Containers = Profit Drupal flexibility is amazing Zequi V´azquez Drupal Extreme Scaling
  • 30. Be sure to practice first, Frodo Zequi V´azquez Drupal Extreme Scaling
  • 31. That’s all, folks! Thank you! @RabbitLair ezequielvazq[at]gmail[dot]com Zequi V´azquez Drupal Extreme Scaling