SlideShare a Scribd company logo
Speeding up the snail
Marcus Deglos
and making Drupal scale
Who is Marcus?
Software engineer
with Ibuildings
Drupal contributor
PADI scuba diving
instructor
The problem with frameworks
The cost of the
framework:
- include files
- function calls
- database queries
So why use Drupal?
• Quicker to develop
• Easier to maintain
Turbo-charging your site
Optimising the stackTuning
Drupal
Adding hardware
Benchmarks
Optimising the stack
• Apache
• PHP
• MySQL
• APC extension
• Varnish
Apache
• Pre-fork vs Worker
mode
• Number of servers /
clients
• Impact of .htaccess
/ AllowOverride
• Impact of SuExec
Optimising the stack
PHP
• CGI vs Apache
Module vc FastCGI
• php.ini:
– Memory limit -
choose for stability
– register_long_
arrays
Optimising the stack
Database
• Optimising the database
– Monitoring with the slow query log
– Add (and remove) indices based on usage
– Consider table types: MYISAM vs INNODB
• Optimising the service
– Custom compilation
– Configuring my.cnf
• Consider your hardware
Optimising the stack
APC
• APC is an op-code
cache
• Install and forget?
• Monitor APC use
• APC tuning
– APC memory usage
– APC stat: checks if
files are modified
– APC filters
Optimising the stack
Varnish
• Varnish is an HTTP
accelerator
• Requires D7,
Pressflow, or a
patch to Drupal
core
• New mindset for
personalising
content - think ESI
Optimising the stack
Tuning Drupal
• Drupal page
cache
• Optimise JS /
CSS
• Memcached
• Using the Drupal
cache
Tuning Drupal
• admin/settings/performance
• Page caching improves performance for
anonymous users
• CSS and JS aggregation improves front-end
performance
Admin : performance settings
Tuning Drupal
Memcached
• Direct replacement for Drupal’s DB cache
• To setup:
– Install the Drupal module
– Configure settings.php
– Install the memcached daemon
– Install the PECL extension
• Minimal tuning (multiple cache ‘bins’)
Tuning Drupal
Using cache_get and cache_set
• Use a static cache for simple queries
static $foo = null;
• Use cache_get and cache_set for
complex objects:
– Multiple DB queries
– Slow remote resources (e.g. SOAP)
Adding hardware
• Separate the web server, database
server and HTTP accelerator onto their
own dedicated hardware
• Horizontal scaling: double the hardware
= double the performance?
• Hunt the bottleneck
• Scale with the cloud - Project Mercury
Benchmarking
• ab
• Jmeter
• Online services
Real world performance
Real world performance
Page cache
Real world performance
Memcache
Real world performance
APC
Real world performance
Varnish
Real world performance
Summary
• Page cache: 2x - 8x
• Memcache: 2.5x
• APC: 1x - 2x
• Varnish: 50x ?
Final thoughts
• Off the shelf :
Pressflow, Zend
Community
Server
• Quick wins:
– Page cache
– Memcache
– APC
– Varnish
That’s all folks!
Image attribution - CC via Flickr
• SNAIL (nutmeg66)
http://www.flickr.com/photos/rachel_s/29060
95941/
• SCUBA - FISH SCHOOL (tobze)
http://www.flickr.com/photos/tobze/2137899
342/
• BALL AND CHAIN (Fred Dawson)
http://www.flickr.com/photos/fwp-
dawson/520311773/
• SPOILER (icathing)
http://www.flickr.com/photos/icathing/26603
225/
• SERVER RACK (Jamison_Judd)
http://www.flickr.com/photos/jamisonjudd/24
33102356/
• GRAPH (tracer.ca)
http://www.flickr.com/photos/tracer/3249533
12/
• STACK (Wonderlane)
http://www.flickr.com/photos/wonderlane/23
63603984/
• TUNING (Crashmaster007)
http://www.flickr.com/photos/crashmaster/33
44052447/
• ROAD END (Joseph Hatfield)
http://www.flickr.com/photos/jhat/218880745
0/
• TORTOISE NAP (MaestroBen)
http://www.flickr.com/photos/maestroben/36
9200383/
• CAMERA (Burnt Pixel)
http://www.flickr.com/photos/keithwj/365098
384/
• QUESTIONS (Stefan Baudy)
http://www.flickr.com/photos/-
bast-/349497988/
• SERVER FARM (sugree)
http://www.flickr.com/photos/sugree/302464
0027/
• CAT (fofurasfelinas)
http://www.flickr.com/photos/fofurasfelinas/1
297744859/
Thanks for coming!
Rate this talk
http://joind.in/620
Download slides
from slideshare
@manarth

More Related Content

PPTX
Performance all teh things
PDF
Drupal feature proposal: two new stream-wrappers
PPTX
Drupal, varnish, esi - Toulouse November 2
PPTX
Varnish bof
PPTX
Caching
PPTX
Using memcache to improve php performance
PPTX
HBaseConEast2016: HBase on Docker with Clusterdock
PPTX
Varnish intro
Performance all teh things
Drupal feature proposal: two new stream-wrappers
Drupal, varnish, esi - Toulouse November 2
Varnish bof
Caching
Using memcache to improve php performance
HBaseConEast2016: HBase on Docker with Clusterdock
Varnish intro

What's hot (20)

PPT
Memcache
PDF
Caching with Varnish
PPT
Roy foubister (hosting high traffic sites on a tight budget)
ODP
Cassandra as Memcache
ODP
The secret life of a dispatcher (Adobe CQ AEM)
PDF
Caching with Memcached and APC
PPT
Architecting cloud
PPT
5-WebServers.ppt
PDF
Aem dispatcher – tips & tricks
PDF
Memcached Presentation
PPTX
Drupal performance optimization Best Practices
PDF
[MathWorks] Versioning Infrastructure
PPT
How to scale your web app
PPT
WE18_Performance_Up.ppt
PDF
03 h base-2-installation_andshell
PDF
DrupalCampLA 2011: Drupal backend-performance
PPTX
SQL Server Integration Services Tips & Tricks
PPTX
Pure Speed Drupal 4 Gov talk
PDF
Install Wordpress in Ubuntu Linux by Tushar B. Kute
PPT
Content Storage With Apache Jackrabbit
Memcache
Caching with Varnish
Roy foubister (hosting high traffic sites on a tight budget)
Cassandra as Memcache
The secret life of a dispatcher (Adobe CQ AEM)
Caching with Memcached and APC
Architecting cloud
5-WebServers.ppt
Aem dispatcher – tips & tricks
Memcached Presentation
Drupal performance optimization Best Practices
[MathWorks] Versioning Infrastructure
How to scale your web app
WE18_Performance_Up.ppt
03 h base-2-installation_andshell
DrupalCampLA 2011: Drupal backend-performance
SQL Server Integration Services Tips & Tricks
Pure Speed Drupal 4 Gov talk
Install Wordpress in Ubuntu Linux by Tushar B. Kute
Content Storage With Apache Jackrabbit
Ad

Viewers also liked (16)

PDF
Resume Roscoe 2016
DOC
FJarin_resume
DOC
Jaffar Naqvi CV
DOCX
Ruckus_prof
PDF
Análise - Esquadrão Verde Tang
PDF
WorkCover Case Review 2015 RJA
PPTX
Diccionario pictórico
DOCX
Valentine's 2016 Resume
DOCX
Ruby RussonR
DOCX
ECON220 PORT PROJ ROUGH DRAFT
DOCX
Victoria Grendell Resume-updated 2015
PPTX
Contrato informatico
PDF
Manejo de medicamentos en el hogar 3
PPTX
Grasscutter farming
PDF
Fitxak 4 hizki direktoak
Resume Roscoe 2016
FJarin_resume
Jaffar Naqvi CV
Ruckus_prof
Análise - Esquadrão Verde Tang
WorkCover Case Review 2015 RJA
Diccionario pictórico
Valentine's 2016 Resume
Ruby RussonR
ECON220 PORT PROJ ROUGH DRAFT
Victoria Grendell Resume-updated 2015
Contrato informatico
Manejo de medicamentos en el hogar 3
Grasscutter farming
Fitxak 4 hizki direktoak
Ad

Similar to Speeding Up The Snail (20)

PPTX
Drupal performance
PDF
Big Data Day LA 2016/ Big Data Track - How To Use Impala and Kudu To Optimize...
PPTX
Fundamentals of performance tuning PHP on IBM i
PDF
DrupalCampLA 2014 - Drupal backend performance and scalability
PPT
AWS (Hadoop) Meetup 30.04.09
PPTX
Performance out
PDF
High Performance Drupal
PPTX
Architectures, Frameworks and Infrastructure
PPTX
Designing enterprise drupal
PDF
Cassandra Summit 2014: Apache Cassandra Best Practices at Ebay
KEY
Introduction to memcached
PDF
071410 sun a_1515_feldman_stephen
PPTX
Migrating enterprise workloads to AWS
PPTX
Apache Performance Tuning: Scaling Out
PPTX
Anthony Somerset - Site Speed = Success!
PPTX
Moving to the Cloud: AWS, Zend, RightScale
PPTX
Cloud - High Availability @ Low Cost - Workshop - Gurpreet ahuja
PPT
Configuring Apache Servers for Better Web Perormance
PPTX
title
PPTX
Performance out
Drupal performance
Big Data Day LA 2016/ Big Data Track - How To Use Impala and Kudu To Optimize...
Fundamentals of performance tuning PHP on IBM i
DrupalCampLA 2014 - Drupal backend performance and scalability
AWS (Hadoop) Meetup 30.04.09
Performance out
High Performance Drupal
Architectures, Frameworks and Infrastructure
Designing enterprise drupal
Cassandra Summit 2014: Apache Cassandra Best Practices at Ebay
Introduction to memcached
071410 sun a_1515_feldman_stephen
Migrating enterprise workloads to AWS
Apache Performance Tuning: Scaling Out
Anthony Somerset - Site Speed = Success!
Moving to the Cloud: AWS, Zend, RightScale
Cloud - High Availability @ Low Cost - Workshop - Gurpreet ahuja
Configuring Apache Servers for Better Web Perormance
title
Performance out

More from Marcus Deglos (6)

PPTX
Vagrant crash course
PPTX
Drupal haters gonna hate
PPTX
With one click
PPTX
Panels rocks!
PDF
SSO To go
PPTX
Where in the world
Vagrant crash course
Drupal haters gonna hate
With one click
Panels rocks!
SSO To go
Where in the world

Recently uploaded (20)

PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
August Patch Tuesday
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
The various Industrial Revolutions .pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
Modernising the Digital Integration Hub
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Hybrid model detection and classification of lung cancer
gpt5_lecture_notes_comprehensive_20250812015547.pdf
O2C Customer Invoices to Receipt V15A.pptx
observCloud-Native Containerability and monitoring.pptx
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
August Patch Tuesday
Enhancing emotion recognition model for a student engagement use case through...
Hindi spoken digit analysis for native and non-native speakers
The various Industrial Revolutions .pptx
NewMind AI Weekly Chronicles - August'25-Week II
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Zenith AI: Advanced Artificial Intelligence
Univ-Connecticut-ChatGPT-Presentaion.pdf
OMC Textile Division Presentation 2021.pptx
Modernising the Digital Integration Hub
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
A comparative study of natural language inference in Swahili using monolingua...
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
TLE Review Electricity (Electricity).pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Hybrid model detection and classification of lung cancer

Speeding Up The Snail

  • 1. Speeding up the snail Marcus Deglos and making Drupal scale
  • 2. Who is Marcus? Software engineer with Ibuildings Drupal contributor PADI scuba diving instructor
  • 3. The problem with frameworks The cost of the framework: - include files - function calls - database queries
  • 4. So why use Drupal? • Quicker to develop • Easier to maintain
  • 5. Turbo-charging your site Optimising the stackTuning Drupal Adding hardware Benchmarks
  • 6. Optimising the stack • Apache • PHP • MySQL • APC extension • Varnish
  • 7. Apache • Pre-fork vs Worker mode • Number of servers / clients • Impact of .htaccess / AllowOverride • Impact of SuExec Optimising the stack
  • 8. PHP • CGI vs Apache Module vc FastCGI • php.ini: – Memory limit - choose for stability – register_long_ arrays Optimising the stack
  • 9. Database • Optimising the database – Monitoring with the slow query log – Add (and remove) indices based on usage – Consider table types: MYISAM vs INNODB • Optimising the service – Custom compilation – Configuring my.cnf • Consider your hardware Optimising the stack
  • 10. APC • APC is an op-code cache • Install and forget? • Monitor APC use • APC tuning – APC memory usage – APC stat: checks if files are modified – APC filters Optimising the stack
  • 11. Varnish • Varnish is an HTTP accelerator • Requires D7, Pressflow, or a patch to Drupal core • New mindset for personalising content - think ESI Optimising the stack
  • 12. Tuning Drupal • Drupal page cache • Optimise JS / CSS • Memcached • Using the Drupal cache
  • 13. Tuning Drupal • admin/settings/performance • Page caching improves performance for anonymous users • CSS and JS aggregation improves front-end performance Admin : performance settings
  • 14. Tuning Drupal Memcached • Direct replacement for Drupal’s DB cache • To setup: – Install the Drupal module – Configure settings.php – Install the memcached daemon – Install the PECL extension • Minimal tuning (multiple cache ‘bins’)
  • 15. Tuning Drupal Using cache_get and cache_set • Use a static cache for simple queries static $foo = null; • Use cache_get and cache_set for complex objects: – Multiple DB queries – Slow remote resources (e.g. SOAP)
  • 16. Adding hardware • Separate the web server, database server and HTTP accelerator onto their own dedicated hardware • Horizontal scaling: double the hardware = double the performance? • Hunt the bottleneck • Scale with the cloud - Project Mercury
  • 23. Real world performance Summary • Page cache: 2x - 8x • Memcache: 2.5x • APC: 1x - 2x • Varnish: 50x ?
  • 24. Final thoughts • Off the shelf : Pressflow, Zend Community Server • Quick wins: – Page cache – Memcache – APC – Varnish
  • 26. Image attribution - CC via Flickr • SNAIL (nutmeg66) http://www.flickr.com/photos/rachel_s/29060 95941/ • SCUBA - FISH SCHOOL (tobze) http://www.flickr.com/photos/tobze/2137899 342/ • BALL AND CHAIN (Fred Dawson) http://www.flickr.com/photos/fwp- dawson/520311773/ • SPOILER (icathing) http://www.flickr.com/photos/icathing/26603 225/ • SERVER RACK (Jamison_Judd) http://www.flickr.com/photos/jamisonjudd/24 33102356/ • GRAPH (tracer.ca) http://www.flickr.com/photos/tracer/3249533 12/ • STACK (Wonderlane) http://www.flickr.com/photos/wonderlane/23 63603984/ • TUNING (Crashmaster007) http://www.flickr.com/photos/crashmaster/33 44052447/ • ROAD END (Joseph Hatfield) http://www.flickr.com/photos/jhat/218880745 0/ • TORTOISE NAP (MaestroBen) http://www.flickr.com/photos/maestroben/36 9200383/ • CAMERA (Burnt Pixel) http://www.flickr.com/photos/keithwj/365098 384/ • QUESTIONS (Stefan Baudy) http://www.flickr.com/photos/- bast-/349497988/ • SERVER FARM (sugree) http://www.flickr.com/photos/sugree/302464 0027/ • CAT (fofurasfelinas) http://www.flickr.com/photos/fofurasfelinas/1 297744859/
  • 27. Thanks for coming! Rate this talk http://joind.in/620 Download slides from slideshare @manarth