SlideShare a Scribd company logo
Optimize Drupal
Make your Drupal site faster
Sunday, May 12, 13
Lê Thanh Sang
• http://drupal.org/user/204321
• Skype: mr.lamphong
• Module Development
• 5 years with Drupal
Sunday, May 12, 13
Agenda
• Hardware
• WebServer
• Drupal
• FrontEnd
• Monitor
Sunday, May 12, 13
Hardware
• Many CPU as possible
• Faster disk IO as possible (Sata < SAS <
SSD < PCI Flash)
Sunday, May 12, 13
Web Server
• Reverse Proxy
• Nginx for static file
• Percona Database server
• PHP-FPM + Opcode (APC, Xcache,
eAccelerator)
• Redis or Memcache
Sunday, May 12, 13
Web Server - Reverse
Proxy
• Use nginx or varnish
• Cache content on RAM (Create a mount
point using tmpfs)
• Allow flush cache on Internal IP. Use purge
module on Drupal.
Sunday, May 12, 13
Web Server
• Using nginx if you can.Apache is fine, use
Reverse Proxy for faster.
• Using mod_pagespeed (http://
code.google.com/p/modpagespeed/)
• For nginx: https://github.com/pagespeed/
ngx_pagespeed
Sunday, May 12, 13
Database Server
• PerconaDB or MariaDB
• Don’t use same server with Drupal if you
can.
• Use master for write
• Slave replication for read
Sunday, May 12, 13
PHP-FPM
• Running via socket (faster than TCP/IP)
• Only install extension we need
• Set max_request
• Turn off log for production
Sunday, May 12, 13
Drupal
• Use Pressflow (Require PHP 5)
• Block cache
• Redis cache
• Authenticated cache
• Remove slow module (Statistics,
admin_menu, tagadelic, nice menus)
• Using xdebug or xhprof for profiling
Sunday, May 12, 13
Drupal theme
• Never use a function in the tpl file, always
on the preprocess function
• In tpl only print variables
• Only use hook_theme (theme, process,
preprocess)
Sunday, May 12, 13
Drupal search
• Don’t use default DB search
• Solr or Elastic Search
Sunday, May 12, 13
FrontEnd
• Browser can send 4~6 request per domain
(2 for IE).
• CSS/JS aggregation
• CDN, Gzip compression, sprites, image
optimization (Done if using
mog_pagespeed)
Sunday, May 12, 13
Summary
Upgrade your hardware is alway a best solution
Sunday, May 12, 13
Question?
Lê Thanh Sang
me@sanglt.com
Sunday, May 12, 13

More Related Content

What's hot

Drupal caching
Drupal cachingDrupal caching
Drupal cachingExove
 
High Performance - Joomla!Days NL 2009 #jd09nl
High Performance - Joomla!Days NL 2009 #jd09nlHigh Performance - Joomla!Days NL 2009 #jd09nl
High Performance - Joomla!Days NL 2009 #jd09nl
Joomla!Days Netherlands
 
Optimizing Drupal Performance. Tips and Tricks
Optimizing Drupal Performance. Tips and TricksOptimizing Drupal Performance. Tips and Tricks
Optimizing Drupal Performance. Tips and Tricks
Timur Kamanin
 
How to reduce database load using Memcache
How to reduce database load using MemcacheHow to reduce database load using Memcache
How to reduce database load using Memcache
valuebound
 
WordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningWordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & Tuning
Timothy Wood
 
Optimizing Drupal Performance (English)
Optimizing Drupal Performance (English)Optimizing Drupal Performance (English)
Optimizing Drupal Performance (English)
Timur Kamanin
 
Memcache and Drupal - Vaibhav Jain
Memcache and Drupal - Vaibhav JainMemcache and Drupal - Vaibhav Jain
Memcache and Drupal - Vaibhav JainDrupal Camp Delhi
 
Speeding up your Drupal site
Speeding up your Drupal siteSpeeding up your Drupal site
Speeding up your Drupal site
Ronan Berder
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sitesdrupalcampest
 
DrupalCamp SP 2015 - Escalando PHP e Drupal- Performance ao infinito e além!
DrupalCamp SP 2015 -  Escalando PHP e Drupal- Performance ao infinito e além!DrupalCamp SP 2015 -  Escalando PHP e Drupal- Performance ao infinito e além!
DrupalCamp SP 2015 - Escalando PHP e Drupal- Performance ao infinito e além!
Taller Negócio Digitais
 
Escalando php e drupal- performance ao infinito e além! - Drupal camp sp 2015
Escalando php e drupal- performance ao infinito e além! - Drupal camp sp 2015Escalando php e drupal- performance ao infinito e além! - Drupal camp sp 2015
Escalando php e drupal- performance ao infinito e além! - Drupal camp sp 2015Handrus Nogueira
 
High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010Barry Abrahamson
 
Magento performance
Magento performanceMagento performance
Magento performance
Divante
 
StripeEu Twistedbytes Presentation
StripeEu Twistedbytes PresentationStripeEu Twistedbytes Presentation
StripeEu Twistedbytes Presentation
twistedbytes
 
Magento performance & optimisation best practices
Magento performance & optimisation best practicesMagento performance & optimisation best practices
Magento performance & optimisation best practices
Philippe Humeau
 
Scaling WordPress
Scaling WordPressScaling WordPress
Scaling WordPress
Joseph Scott
 
High Performance Wordpress
High Performance WordpressHigh Performance Wordpress
High Performance Wordpress
Gareth Davies
 

What's hot (19)

Drupal caching
Drupal cachingDrupal caching
Drupal caching
 
High Performance - Joomla!Days NL 2009 #jd09nl
High Performance - Joomla!Days NL 2009 #jd09nlHigh Performance - Joomla!Days NL 2009 #jd09nl
High Performance - Joomla!Days NL 2009 #jd09nl
 
Optimizing Drupal Performance. Tips and Tricks
Optimizing Drupal Performance. Tips and TricksOptimizing Drupal Performance. Tips and Tricks
Optimizing Drupal Performance. Tips and Tricks
 
How to reduce database load using Memcache
How to reduce database load using MemcacheHow to reduce database load using Memcache
How to reduce database load using Memcache
 
WordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningWordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & Tuning
 
Optimizing Drupal Performance (English)
Optimizing Drupal Performance (English)Optimizing Drupal Performance (English)
Optimizing Drupal Performance (English)
 
Memcache and Drupal - Vaibhav Jain
Memcache and Drupal - Vaibhav JainMemcache and Drupal - Vaibhav Jain
Memcache and Drupal - Vaibhav Jain
 
Speeding up your Drupal site
Speeding up your Drupal siteSpeeding up your Drupal site
Speeding up your Drupal site
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sites
 
04 web optimization
04 web optimization04 web optimization
04 web optimization
 
DrupalCamp SP 2015 - Escalando PHP e Drupal- Performance ao infinito e além!
DrupalCamp SP 2015 -  Escalando PHP e Drupal- Performance ao infinito e além!DrupalCamp SP 2015 -  Escalando PHP e Drupal- Performance ao infinito e além!
DrupalCamp SP 2015 - Escalando PHP e Drupal- Performance ao infinito e além!
 
Escalando php e drupal- performance ao infinito e além! - Drupal camp sp 2015
Escalando php e drupal- performance ao infinito e além! - Drupal camp sp 2015Escalando php e drupal- performance ao infinito e além! - Drupal camp sp 2015
Escalando php e drupal- performance ao infinito e além! - Drupal camp sp 2015
 
High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010
 
Magento performance
Magento performanceMagento performance
Magento performance
 
StripeEu Twistedbytes Presentation
StripeEu Twistedbytes PresentationStripeEu Twistedbytes Presentation
StripeEu Twistedbytes Presentation
 
Svcc
SvccSvcc
Svcc
 
Magento performance & optimisation best practices
Magento performance & optimisation best practicesMagento performance & optimisation best practices
Magento performance & optimisation best practices
 
Scaling WordPress
Scaling WordPressScaling WordPress
Scaling WordPress
 
High Performance Wordpress
High Performance WordpressHigh Performance Wordpress
High Performance Wordpress
 

Viewers also liked

Appendix
AppendixAppendix
Appendixjegosss
 
Composer manager module for Drupal
Composer manager module for DrupalComposer manager module for Drupal
Composer manager module for Drupal
Le Thanh Sang
 
Insurance Tailors
Insurance TailorsInsurance Tailors
Insurance Tailors
Monty2877
 
Milieu Problematiek
Milieu ProblematiekMilieu Problematiek
Milieu ProblematiekH Y
 
Drupal hhvm benchmark
Drupal hhvm benchmarkDrupal hhvm benchmark
Drupal hhvm benchmark
Le Thanh Sang
 
Jet Tailors 2009
Jet Tailors 2009Jet Tailors 2009
Jet Tailors 2009Monty2877
 
Matlab handout#2
Matlab handout#2Matlab handout#2
Matlab handout#2jegosss
 
Insurance Tailors White Labeling 09
Insurance Tailors White Labeling 09Insurance Tailors White Labeling 09
Insurance Tailors White Labeling 09Monty2877
 
Modul 4. doe rcbd
Modul 4. doe rcbdModul 4. doe rcbd
Modul 4. doe rcbdjegosss
 
Modul 2. simple comparative experiments
Modul 2. simple comparative experimentsModul 2. simple comparative experiments
Modul 2. simple comparative experimentsjegosss
 
SpareBank 1 Group Q1 2016
SpareBank 1 Group Q1 2016SpareBank 1 Group Q1 2016
SpareBank 1 Group Q1 2016
SpareBank 1 Gruppen AS
 
Analytikerpresentasjon SpareBank 1 Gruppen Q1 2016
Analytikerpresentasjon SpareBank 1 Gruppen Q1 2016Analytikerpresentasjon SpareBank 1 Gruppen Q1 2016
Analytikerpresentasjon SpareBank 1 Gruppen Q1 2016
SpareBank 1 Gruppen AS
 
Analytikerpresentasjon SpareBank 1 Gruppen 2. kvartal 2016-NY!
Analytikerpresentasjon SpareBank 1 Gruppen 2. kvartal 2016-NY!Analytikerpresentasjon SpareBank 1 Gruppen 2. kvartal 2016-NY!
Analytikerpresentasjon SpareBank 1 Gruppen 2. kvartal 2016-NY!
SpareBank 1 Gruppen AS
 
Analytikerpresentasjon SpareBank 1 Gruppen Q3 2016
Analytikerpresentasjon SpareBank 1 Gruppen Q3 2016Analytikerpresentasjon SpareBank 1 Gruppen Q3 2016
Analytikerpresentasjon SpareBank 1 Gruppen Q3 2016
SpareBank 1 Gruppen AS
 

Viewers also liked (17)

Appendix
AppendixAppendix
Appendix
 
Composer manager module for Drupal
Composer manager module for DrupalComposer manager module for Drupal
Composer manager module for Drupal
 
Insurance Tailors
Insurance TailorsInsurance Tailors
Insurance Tailors
 
Milieu Problematiek
Milieu ProblematiekMilieu Problematiek
Milieu Problematiek
 
Drupal hhvm benchmark
Drupal hhvm benchmarkDrupal hhvm benchmark
Drupal hhvm benchmark
 
Milieu
MilieuMilieu
Milieu
 
Cam nang
Cam nangCam nang
Cam nang
 
Jet Tailors 2009
Jet Tailors 2009Jet Tailors 2009
Jet Tailors 2009
 
Matlab handout#2
Matlab handout#2Matlab handout#2
Matlab handout#2
 
Insurance Tailors White Labeling 09
Insurance Tailors White Labeling 09Insurance Tailors White Labeling 09
Insurance Tailors White Labeling 09
 
Modul 4. doe rcbd
Modul 4. doe rcbdModul 4. doe rcbd
Modul 4. doe rcbd
 
Modul 2. simple comparative experiments
Modul 2. simple comparative experimentsModul 2. simple comparative experiments
Modul 2. simple comparative experiments
 
Kaizen
KaizenKaizen
Kaizen
 
SpareBank 1 Group Q1 2016
SpareBank 1 Group Q1 2016SpareBank 1 Group Q1 2016
SpareBank 1 Group Q1 2016
 
Analytikerpresentasjon SpareBank 1 Gruppen Q1 2016
Analytikerpresentasjon SpareBank 1 Gruppen Q1 2016Analytikerpresentasjon SpareBank 1 Gruppen Q1 2016
Analytikerpresentasjon SpareBank 1 Gruppen Q1 2016
 
Analytikerpresentasjon SpareBank 1 Gruppen 2. kvartal 2016-NY!
Analytikerpresentasjon SpareBank 1 Gruppen 2. kvartal 2016-NY!Analytikerpresentasjon SpareBank 1 Gruppen 2. kvartal 2016-NY!
Analytikerpresentasjon SpareBank 1 Gruppen 2. kvartal 2016-NY!
 
Analytikerpresentasjon SpareBank 1 Gruppen Q3 2016
Analytikerpresentasjon SpareBank 1 Gruppen Q3 2016Analytikerpresentasjon SpareBank 1 Gruppen Q3 2016
Analytikerpresentasjon SpareBank 1 Gruppen Q3 2016
 

Similar to Optimize drupal

Pure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkPure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talk
Bryan Ollendyke
 
Elephants in the Cloud
Elephants in the CloudElephants in the Cloud
Elephants in the Cloud
Mike Fowler
 
Php go vrooom!
Php go vrooom!Php go vrooom!
Php go vrooom!
Elizabeth Smith
 
Let's speed it up a bit (AmsterdamPHP)
Let's speed it up a bit (AmsterdamPHP)Let's speed it up a bit (AmsterdamPHP)
Let's speed it up a bit (AmsterdamPHP)
pascaldevink
 
DrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilityDrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalability
cherryhillco
 
Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!
WordCamp Cape Town
 
Escalando php e drupal- performance ao infinito e além! - DrupalCamp SP 2015
Escalando php e drupal- performance ao infinito e além! - DrupalCamp SP 2015Escalando php e drupal- performance ao infinito e além! - DrupalCamp SP 2015
Escalando php e drupal- performance ao infinito e além! - DrupalCamp SP 2015
Handrus Nogueira
 
Drupal Development Tips
Drupal Development TipsDrupal Development Tips
Drupal Development Tips
Chris Tankersley
 
Escalando PHP e Drupal: performance ao infinito e além! - DrupalCamp SP 2015
Escalando PHP e Drupal: performance ao infinito e além! - DrupalCamp SP 2015Escalando PHP e Drupal: performance ao infinito e além! - DrupalCamp SP 2015
Escalando PHP e Drupal: performance ao infinito e além! - DrupalCamp SP 2015
Lucas Arruda
 
Proud to be polyglot!
Proud to be polyglot!Proud to be polyglot!
Proud to be polyglot!NLJUG
 
Optimizing Your Frontend Performance
Optimizing Your Frontend PerformanceOptimizing Your Frontend Performance
Optimizing Your Frontend PerformanceThomas Weinert
 
Fundamentals of performance tuning PHP on IBM i
Fundamentals of performance tuning PHP on IBM i  Fundamentals of performance tuning PHP on IBM i
Fundamentals of performance tuning PHP on IBM i
Zend by Rogue Wave Software
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
Jeff Geerling
 
Nginx [engine x] and you (and WordPress)
Nginx [engine x] and you (and WordPress)Nginx [engine x] and you (and WordPress)
Nginx [engine x] and you (and WordPress)
Justin Foell
 
Screaming Fast Wpmu
Screaming Fast WpmuScreaming Fast Wpmu
Screaming Fast Wpmudjcp
 
DrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performanceDrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performance
Ashok Modi
 
Drupal 6 - podstawy - www.openbit.pl
Drupal 6 - podstawy - www.openbit.plDrupal 6 - podstawy - www.openbit.pl
Drupal 6 - podstawy - www.openbit.pl
Grzegorz Bartman
 
Speeding Up The Snail
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The Snail
Marcus Deglos
 
Drupal Backend Performance and Scalability
Drupal Backend Performance and ScalabilityDrupal Backend Performance and Scalability
Drupal Backend Performance and ScalabilityAshok Modi
 

Similar to Optimize drupal (20)

Pure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkPure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talk
 
Elephants in the Cloud
Elephants in the CloudElephants in the Cloud
Elephants in the Cloud
 
Php go vrooom!
Php go vrooom!Php go vrooom!
Php go vrooom!
 
Drupal performance
Drupal performanceDrupal performance
Drupal performance
 
Let's speed it up a bit (AmsterdamPHP)
Let's speed it up a bit (AmsterdamPHP)Let's speed it up a bit (AmsterdamPHP)
Let's speed it up a bit (AmsterdamPHP)
 
DrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalabilityDrupalCampLA 2014 - Drupal backend performance and scalability
DrupalCampLA 2014 - Drupal backend performance and scalability
 
Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!
 
Escalando php e drupal- performance ao infinito e além! - DrupalCamp SP 2015
Escalando php e drupal- performance ao infinito e além! - DrupalCamp SP 2015Escalando php e drupal- performance ao infinito e além! - DrupalCamp SP 2015
Escalando php e drupal- performance ao infinito e além! - DrupalCamp SP 2015
 
Drupal Development Tips
Drupal Development TipsDrupal Development Tips
Drupal Development Tips
 
Escalando PHP e Drupal: performance ao infinito e além! - DrupalCamp SP 2015
Escalando PHP e Drupal: performance ao infinito e além! - DrupalCamp SP 2015Escalando PHP e Drupal: performance ao infinito e além! - DrupalCamp SP 2015
Escalando PHP e Drupal: performance ao infinito e além! - DrupalCamp SP 2015
 
Proud to be polyglot!
Proud to be polyglot!Proud to be polyglot!
Proud to be polyglot!
 
Optimizing Your Frontend Performance
Optimizing Your Frontend PerformanceOptimizing Your Frontend Performance
Optimizing Your Frontend Performance
 
Fundamentals of performance tuning PHP on IBM i
Fundamentals of performance tuning PHP on IBM i  Fundamentals of performance tuning PHP on IBM i
Fundamentals of performance tuning PHP on IBM i
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
 
Nginx [engine x] and you (and WordPress)
Nginx [engine x] and you (and WordPress)Nginx [engine x] and you (and WordPress)
Nginx [engine x] and you (and WordPress)
 
Screaming Fast Wpmu
Screaming Fast WpmuScreaming Fast Wpmu
Screaming Fast Wpmu
 
DrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performanceDrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performance
 
Drupal 6 - podstawy - www.openbit.pl
Drupal 6 - podstawy - www.openbit.plDrupal 6 - podstawy - www.openbit.pl
Drupal 6 - podstawy - www.openbit.pl
 
Speeding Up The Snail
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The Snail
 
Drupal Backend Performance and Scalability
Drupal Backend Performance and ScalabilityDrupal Backend Performance and Scalability
Drupal Backend Performance and Scalability
 

Optimize drupal

  • 1. Optimize Drupal Make your Drupal site faster Sunday, May 12, 13
  • 2. Lê Thanh Sang • http://drupal.org/user/204321 • Skype: mr.lamphong • Module Development • 5 years with Drupal Sunday, May 12, 13
  • 3. Agenda • Hardware • WebServer • Drupal • FrontEnd • Monitor Sunday, May 12, 13
  • 4. Hardware • Many CPU as possible • Faster disk IO as possible (Sata < SAS < SSD < PCI Flash) Sunday, May 12, 13
  • 5. Web Server • Reverse Proxy • Nginx for static file • Percona Database server • PHP-FPM + Opcode (APC, Xcache, eAccelerator) • Redis or Memcache Sunday, May 12, 13
  • 6. Web Server - Reverse Proxy • Use nginx or varnish • Cache content on RAM (Create a mount point using tmpfs) • Allow flush cache on Internal IP. Use purge module on Drupal. Sunday, May 12, 13
  • 7. Web Server • Using nginx if you can.Apache is fine, use Reverse Proxy for faster. • Using mod_pagespeed (http:// code.google.com/p/modpagespeed/) • For nginx: https://github.com/pagespeed/ ngx_pagespeed Sunday, May 12, 13
  • 8. Database Server • PerconaDB or MariaDB • Don’t use same server with Drupal if you can. • Use master for write • Slave replication for read Sunday, May 12, 13
  • 9. PHP-FPM • Running via socket (faster than TCP/IP) • Only install extension we need • Set max_request • Turn off log for production Sunday, May 12, 13
  • 10. Drupal • Use Pressflow (Require PHP 5) • Block cache • Redis cache • Authenticated cache • Remove slow module (Statistics, admin_menu, tagadelic, nice menus) • Using xdebug or xhprof for profiling Sunday, May 12, 13
  • 11. Drupal theme • Never use a function in the tpl file, always on the preprocess function • In tpl only print variables • Only use hook_theme (theme, process, preprocess) Sunday, May 12, 13
  • 12. Drupal search • Don’t use default DB search • Solr or Elastic Search Sunday, May 12, 13
  • 13. FrontEnd • Browser can send 4~6 request per domain (2 for IE). • CSS/JS aggregation • CDN, Gzip compression, sprites, image optimization (Done if using mog_pagespeed) Sunday, May 12, 13
  • 14. Summary Upgrade your hardware is alway a best solution Sunday, May 12, 13