SlideShare a Scribd company logo
High Performance Drupal
Jeff Geerling
Technical Architect, Acqia
geerlingguy
• Hosted Apache Solr
• Server Check.in
• Ansible for DevOps
• Technical Architect
"Drupal is SLOW!"
"Drupal is SLOW!"
"It's actually hard to intentionally make Drupal slow."
- Me, when creating this presentation
Agenda
1. Process for performance improvement
2. Easy Wins for Drupal performance
3. Live site performance improvement demo
Process
• Have a plan:
• "Front page should load in < 2 seconds for
anonymous users."
• "Time to first byte should be < 500ms for
anonymous users."
Process
• Have a plan:
• "Front page should load in < 2 seconds for
anonymous users."
• "Time to first byte should be < 500ms for
anonymous users."
Process
• Run benchmarks:
• TTFB, Full page load, DOM complete, etc.
Process
hard
low
high
easy
Performance
Improvement
Difficulty
Process
hard
low
high
easy
Performance
Improvement
Difficulty
Good
Process
hard
low
high
easy
Performance
Improvement
Difficulty
Good
Bad
Process
hard
low
high
easy
Performance
Improvement
Difficulty
Good
Bad
"m
eh"
Process
hard
low
high
easy
Performance
Improvement
Difficulty
Good
Bad
"m
eh"
Focus on this area
Useful Tools
• Chrome Developer Tools
• Devel, drush
• XHProf (and sometimes XDebug)
• WebPagetest.org
• GTmetrix
• Pingdom Website Speed Test
• ab / wrk / jmeter
Focus on ROI
Focus on fixes that produce order-of-magnitude gains first!
Easy Wins - Drupal
• General
• KISS: Remove modules, simplify layouts... be ruthless!
• Use Boost (if no Varnish/Nginx static cache)
• Disable dblog module
Easy Wins - Drupal
• Caching
• Enable anonymous page cache (default in D8)
• Views: use views caching (+ Views cache bully... but not
needed in D8!), use Litepager
• Use panels, block, entity caching
• Watch for cache-breaking elements (e.g. login block +
Honeypot, etc.)
Easy Wins - Drupal
• On the edge of 'easy'
• Use drupal_fast_404() + Fast 404
• Avoid redirects inside Drupal (convenience tradeoff)
• Use drush for cron, use Elysia Cron
Easy Wins - Backend
• Apache / Nginx
• "Use PHP-FPM instead of Apache mod_php"
• Not really this simple; more about smart
resource allocation
• More CPU cores, more RAM
Easy Wins - Backend
• PHP
• Run version 5.5+
• Make sure OpCache can hold all your code

(opcache_get_status())
• MySQL
• innodb_buffer_size - database in RAM
• slow_query_log - watch it!
Easy Wins - Front End
• Optimize images (smaller sizes w/ styles, fewer
images per page, lazy loading)
• Enable CSS/JS Aggregation, consider advagg
• Use CloudFlare or another CDN
• YSlow/PageSpeed - Fix easy configuration
changes (expires, etags, etc.)
• Remove external / social widgets and embeds
Easy Wins - Front End
• External service integrations are often the #1
or #2 performance burden for front-end page
load times.
• Social widgets
• Embedded media
• Ads, tracking
• iframe content
Let's Do This Thing!
1. Plan
2. Benchmark
3. Adjust
4. Benchmark again
1. Plan
• Home page should load in <1s for anonymous
users over a local network connection
• Home page should load in <2s for authenticated
users over a local network connection
• Assumptions:
• Site has mostly anonymous traffic
• Site serves a single geographical region, mostly
desktop users
1. Plan
• Home page should load in <1s for anonymous
users over a local network connection
• Home page should load in <2s for authenticated
users over a local network connection
• Assumptions:
• Site has mostly anonymous traffic
• Site serves a single geographical region, mostly
desktop users
Important!
Demo site: http://hp-drupal.dev/
(running on Drupal VM)
2. Benchmark
Chrome Dev Tools:
• View > Developer >

Developer Tools
• Option + ⌘ + I (Mac)
• Ctrl + Shift + C (Win/Linux)
Network tab
DOMContentLoaded
Load (total time)
2. Benchmark
$ time drush @alias php-eval '
$path="front";
menu_set_active_item($path);
menu_execute_active_handler($path, TRUE);' > /dev/null
$ wrk -t2 -c4 -d30s http://www.example.com/
$ ab -n 50 -c 2 http://www.example.com/
Test PHP/Drupal alone:
Test Backend alone:
2. Benchmark
Benchmark Before After
DOMContentLoaded ~1.6s ?
Load (Full) ~4.0s ?
drush (backend) ~2.0s ?
wrk (load test) ~1.75 req/s ?
3. Adjust
Symptom Indication
Large BE/FE Δ Slow-loading FE resources
Long TTFB* (> 1s) Backend response slow
~2 req/s capacity Site will scale... poorly
*TTFB = Time To First Byte
3. Adjust
• Add Caching
• Beware lipstick on a pig!
• Caches should make what's good, better
• Stop the bleeding first
• Easy Wins, then harder things like slow queries
and code fixes
4. Benchmark again
Benchmark Before After
DOMContentLoaded ~1.6s ~0.2s
Load (Full) ~4.0s ~0.2s
drush (backend) ~2.0s ~0.8s
wrk (load test) ~1.75 req/s ~437 req/s
Bonus Round
4. Benchmark again
Benchmark Before After + VARNISH
DOMContentLoaded ~1.6s ~0.1s
Load (Full) ~4.0s ~0.1s
drush (backend) ~2.0s ~
wrk (load test) ~1.75 req/s ~4,000 req/s
Other Considerations
• Monitoring:
• Uptime (Pingdom, Server Check.in, etc.)
• Performance (AppNeta, NewRelic)
• Resource usage (Munin, Cacti, Icinga)
• Infrastructure - HA, Scalability
• UX and performance
Other Resources
• High Performance Drupal (O'Reilly)
• Drupal VM (optimized LAMP stack)
• Ansible for DevOps (infrastructure focus)

More Related Content

PDF
Server Check.in case study - Drupal and Node.js
PDF
Ansible 101 - Presentation at Ansible STL Meetup
PDF
Highly available Drupal on a Raspberry Pi cluster
PDF
Ansible for Drupal infrastructure and deployments
PDF
Ansible
PDF
Drupal VM for Drupal 8 Dev - MidCamp 2017
PPTX
Ansible for large scale deployment
PDF
Ansible - Hands on Training
Server Check.in case study - Drupal and Node.js
Ansible 101 - Presentation at Ansible STL Meetup
Highly available Drupal on a Raspberry Pi cluster
Ansible for Drupal infrastructure and deployments
Ansible
Drupal VM for Drupal 8 Dev - MidCamp 2017
Ansible for large scale deployment
Ansible - Hands on Training

What's hot (20)

PDF
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
PDF
Stress Free Deployment - Confoo 2011
PDF
How Ansible Makes Automation Easy
ODP
Using Ansible at Scale to Manage a Public Cloud
PDF
Continuous Testing with Molecule, Ansible, and GitHub Actions
PPTX
Extending Ansible - Ansible Benelux meetup - Amsterdam 11-02-2016
KEY
Performance and scalability with drupal
PDF
Back to the 90s' - Revenge of the static website
PDF
WordPress and The Command Line
PPTX
Extending ansible
PDF
Automated Deployment and Configuration Engines. Ansible
ODP
CommandBox REPL, CLI, and Package Manager
PPTX
Putting the 'ctions' in Azure Fun-ctions
PPTX
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
ODP
Introduction to Chef
PPTX
Pure Speed Drupal 4 Gov talk
PDF
Put a Button on It: Removing Barriers to Going Fast
PDF
Chef Fundamentals Training Series Module 2: Workstation Setup
PDF
Agiles Peru 2019 - Infrastructure As Code
PDF
03 ansible towerbestpractices-nicholas
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Stress Free Deployment - Confoo 2011
How Ansible Makes Automation Easy
Using Ansible at Scale to Manage a Public Cloud
Continuous Testing with Molecule, Ansible, and GitHub Actions
Extending Ansible - Ansible Benelux meetup - Amsterdam 11-02-2016
Performance and scalability with drupal
Back to the 90s' - Revenge of the static website
WordPress and The Command Line
Extending ansible
Automated Deployment and Configuration Engines. Ansible
CommandBox REPL, CLI, and Package Manager
Putting the 'ctions' in Azure Fun-ctions
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
Introduction to Chef
Pure Speed Drupal 4 Gov talk
Put a Button on It: Removing Barriers to Going Fast
Chef Fundamentals Training Series Module 2: Workstation Setup
Agiles Peru 2019 - Infrastructure As Code
03 ansible towerbestpractices-nicholas
Ad

Viewers also liked (10)

PDF
ProTips for Staying Sane while Working from Home
PDF
Ansible 2 and Ansible Galaxy 2
PDF
Ansible + Drupal: A Fortuitous DevOps Match
ODP
Drupal Performance and Scaling
PDF
Drupal Performance Audit and Optimization
PPTX
Improving Drupal Performances
PDF
Scaling Drupal on Amazon Web Services (DrupalCamp Brighton)
PPT
Scaling drupal horizontally and in cloud
PDF
Drupal 8 - A Brief Introduction
PDF
DevOps for Humans - Ansible for Drupal Deployment Victory!
ProTips for Staying Sane while Working from Home
Ansible 2 and Ansible Galaxy 2
Ansible + Drupal: A Fortuitous DevOps Match
Drupal Performance and Scaling
Drupal Performance Audit and Optimization
Improving Drupal Performances
Scaling Drupal on Amazon Web Services (DrupalCamp Brighton)
Scaling drupal horizontally and in cloud
Drupal 8 - A Brief Introduction
DevOps for Humans - Ansible for Drupal Deployment Victory!
Ad

Similar to High Performance Drupal (20)

PDF
Drupal Performance : DrupalCamp North
PPT
Make Drupal Run Fast - increase page load speed
ODP
Speeding up your Drupal site
PDF
Drupal 7 performance and optimization
PPTX
Drupal 8 Lessons From the Field: Part 3 - The Drupal Backend
PDF
High Performance Drupal
PDF
Drupal performance and scalability
PPTX
Performance Optimization in Drupal 8
PPTX
Drupal performance
PDF
Simple Tips to Improve Site Performance (No Coding Required!)
PPT
Drupalcamp Estonia - High Performance Sites
PPT
Drupalcamp Estonia - High Performance Sites
ODP
Optimizing Drupal Performance. Tips and Tricks
PDF
DrupalCampLA 2014 - Drupal backend performance and scalability
PDF
DrupalSouth 2015 - Performance: Not an Afterthought
PDF
Make your drupal site perform
PPTX
Drupal performance optimization Best Practices
PPT
Drupal caching
PDF
Common Pitfalls for your Drupal Site, and How to Avoid Them
PPTX
Drupal performance
Drupal Performance : DrupalCamp North
Make Drupal Run Fast - increase page load speed
Speeding up your Drupal site
Drupal 7 performance and optimization
Drupal 8 Lessons From the Field: Part 3 - The Drupal Backend
High Performance Drupal
Drupal performance and scalability
Performance Optimization in Drupal 8
Drupal performance
Simple Tips to Improve Site Performance (No Coding Required!)
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sites
Optimizing Drupal Performance. Tips and Tricks
DrupalCampLA 2014 - Drupal backend performance and scalability
DrupalSouth 2015 - Performance: Not an Afterthought
Make your drupal site perform
Drupal performance optimization Best Practices
Drupal caching
Common Pitfalls for your Drupal Site, and How to Avoid Them
Drupal performance

More from Jeff Geerling (10)

PDF
2020 Drupal Local Development Tools Survey - CMS Philly
PDF
There's a role for that! (AnsibleFest 2019)
PDF
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
PDF
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
PDF
Make your Ansible playbooks maintainable, flexible, and scalable
PDF
Ansible and Kubernetes
PDF
HTTPS and Ansible
PPT
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
PPT
Florissant TIF - Cross Keys Redevelopment
PDF
How to Build a Drupal Module
2020 Drupal Local Development Tools Survey - CMS Philly
There's a role for that! (AnsibleFest 2019)
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Make your Ansible playbooks maintainable, flexible, and scalable
Ansible and Kubernetes
HTTPS and Ansible
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Florissant TIF - Cross Keys Redevelopment
How to Build a Drupal Module

Recently uploaded (20)

PDF
System and Network Administration Chapter 2
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Transform Your Business with a Software ERP System
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Digital Strategies for Manufacturing Companies
PPTX
Introduction to Artificial Intelligence
PPTX
CHAPTER 2 - PM Management and IT Context
System and Network Administration Chapter 2
Odoo POS Development Services by CandidRoot Solutions
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Softaken Excel to vCard Converter Software.pdf
Transform Your Business with a Software ERP System
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
How Creative Agencies Leverage Project Management Software.pdf
Understanding Forklifts - TECH EHS Solution
Upgrade and Innovation Strategies for SAP ERP Customers
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
How to Migrate SBCGlobal Email to Yahoo Easily
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PTS Company Brochure 2025 (1).pdf.......
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Digital Strategies for Manufacturing Companies
Introduction to Artificial Intelligence
CHAPTER 2 - PM Management and IT Context

High Performance Drupal

  • 1. High Performance Drupal Jeff Geerling Technical Architect, Acqia
  • 2. geerlingguy • Hosted Apache Solr • Server Check.in • Ansible for DevOps • Technical Architect
  • 5. "It's actually hard to intentionally make Drupal slow." - Me, when creating this presentation
  • 6. Agenda 1. Process for performance improvement 2. Easy Wins for Drupal performance 3. Live site performance improvement demo
  • 7. Process • Have a plan: • "Front page should load in < 2 seconds for anonymous users." • "Time to first byte should be < 500ms for anonymous users."
  • 8. Process • Have a plan: • "Front page should load in < 2 seconds for anonymous users." • "Time to first byte should be < 500ms for anonymous users."
  • 9. Process • Run benchmarks: • TTFB, Full page load, DOM complete, etc.
  • 15. Useful Tools • Chrome Developer Tools • Devel, drush • XHProf (and sometimes XDebug) • WebPagetest.org • GTmetrix • Pingdom Website Speed Test • ab / wrk / jmeter
  • 16. Focus on ROI Focus on fixes that produce order-of-magnitude gains first!
  • 17. Easy Wins - Drupal • General • KISS: Remove modules, simplify layouts... be ruthless! • Use Boost (if no Varnish/Nginx static cache) • Disable dblog module
  • 18. Easy Wins - Drupal • Caching • Enable anonymous page cache (default in D8) • Views: use views caching (+ Views cache bully... but not needed in D8!), use Litepager • Use panels, block, entity caching • Watch for cache-breaking elements (e.g. login block + Honeypot, etc.)
  • 19. Easy Wins - Drupal • On the edge of 'easy' • Use drupal_fast_404() + Fast 404 • Avoid redirects inside Drupal (convenience tradeoff) • Use drush for cron, use Elysia Cron
  • 20. Easy Wins - Backend • Apache / Nginx • "Use PHP-FPM instead of Apache mod_php" • Not really this simple; more about smart resource allocation • More CPU cores, more RAM
  • 21. Easy Wins - Backend • PHP • Run version 5.5+ • Make sure OpCache can hold all your code
 (opcache_get_status()) • MySQL • innodb_buffer_size - database in RAM • slow_query_log - watch it!
  • 22. Easy Wins - Front End • Optimize images (smaller sizes w/ styles, fewer images per page, lazy loading) • Enable CSS/JS Aggregation, consider advagg • Use CloudFlare or another CDN • YSlow/PageSpeed - Fix easy configuration changes (expires, etags, etc.) • Remove external / social widgets and embeds
  • 23. Easy Wins - Front End • External service integrations are often the #1 or #2 performance burden for front-end page load times. • Social widgets • Embedded media • Ads, tracking • iframe content
  • 24. Let's Do This Thing! 1. Plan 2. Benchmark 3. Adjust 4. Benchmark again
  • 25. 1. Plan • Home page should load in <1s for anonymous users over a local network connection • Home page should load in <2s for authenticated users over a local network connection • Assumptions: • Site has mostly anonymous traffic • Site serves a single geographical region, mostly desktop users
  • 26. 1. Plan • Home page should load in <1s for anonymous users over a local network connection • Home page should load in <2s for authenticated users over a local network connection • Assumptions: • Site has mostly anonymous traffic • Site serves a single geographical region, mostly desktop users Important!
  • 28. 2. Benchmark Chrome Dev Tools: • View > Developer >
 Developer Tools • Option + ⌘ + I (Mac) • Ctrl + Shift + C (Win/Linux) Network tab DOMContentLoaded Load (total time)
  • 29. 2. Benchmark $ time drush @alias php-eval ' $path="front"; menu_set_active_item($path); menu_execute_active_handler($path, TRUE);' > /dev/null $ wrk -t2 -c4 -d30s http://www.example.com/ $ ab -n 50 -c 2 http://www.example.com/ Test PHP/Drupal alone: Test Backend alone:
  • 30. 2. Benchmark Benchmark Before After DOMContentLoaded ~1.6s ? Load (Full) ~4.0s ? drush (backend) ~2.0s ? wrk (load test) ~1.75 req/s ?
  • 31. 3. Adjust Symptom Indication Large BE/FE Δ Slow-loading FE resources Long TTFB* (> 1s) Backend response slow ~2 req/s capacity Site will scale... poorly *TTFB = Time To First Byte
  • 32. 3. Adjust • Add Caching • Beware lipstick on a pig! • Caches should make what's good, better • Stop the bleeding first • Easy Wins, then harder things like slow queries and code fixes
  • 33. 4. Benchmark again Benchmark Before After DOMContentLoaded ~1.6s ~0.2s Load (Full) ~4.0s ~0.2s drush (backend) ~2.0s ~0.8s wrk (load test) ~1.75 req/s ~437 req/s
  • 35. 4. Benchmark again Benchmark Before After + VARNISH DOMContentLoaded ~1.6s ~0.1s Load (Full) ~4.0s ~0.1s drush (backend) ~2.0s ~ wrk (load test) ~1.75 req/s ~4,000 req/s
  • 36. Other Considerations • Monitoring: • Uptime (Pingdom, Server Check.in, etc.) • Performance (AppNeta, NewRelic) • Resource usage (Munin, Cacti, Icinga) • Infrastructure - HA, Scalability • UX and performance
  • 37. Other Resources • High Performance Drupal (O'Reilly) • Drupal VM (optimized LAMP stack) • Ansible for DevOps (infrastructure focus)