SlideShare a Scribd company logo
Scaling PHP and Drupal
Handrus Nogueira
handrus@taller.net.br
@handrus
Lucas Arruda
lucas@ciandt.com
@lunascarruda
Handrus
Based on Florianópolis-SC / BR
Software Architect / Dev @ Taller
Web & Open-Source & Agile
~11 yrs on the road
Drupaler for ~7 yrs
Dev with Passion!
Lucas Arruda
Software Architect @ CI&T DCO
Open-Source enthusiast
Acquia Certified Developer
Based on Campinas-SP / Brazil
Zend Certified Engineer PHP 5.3
Drupaler for 4+ yrs
GCP Authorized Trainer & Qualified Dev.
The Basics
Use the latest PHP stable version
Source: https://blog.asmallorange.com/2013/08/php-roadmap-performance/
Use the latest PHP stable version
Source: https://www.lourdas.name/blog/php-53-vs-54-vs-55-speed-and-memory-usage
Source: http://php.net/manual/en/features.gc.performance-considerations.php
Use the latest PHP stable version
Source: http://www.lornajane.net/posts/2014/php-5-6-benchmarks
Source: http://zsuraski.blogspot.com.au/2014/07/benchmarking-phpng.html
DrupalCamp SP 2015 -  Escalando PHP e Drupal- Performance ao infinito e além!
Source: https://kinsta.com/blog/hhvm-vs-php-7/
Disable unnecessary PHP extensions and web-server modules
● PHP extensions consume memory heap
● Some badly written can cause memory leaks
● The same applies for web-server modules
● Disable if you don’t need them!
2Read: http://www.slideshare.net/jpauli/help-im-leaking-memory-in-php
Fine tune your php.ini!
● memory_limit
memory_get_usage() / memory_get_peak_usage()
● realpath_cache_size
realpath_cache_get()
● realpath_cache_ttl
Max execution per thread - will affect memory usage!
mod_php
vs.
FastCGI
vs.
PHP-FPM
Apache
vs.
Nginx
2Read: http://www.prinew.com/mod-php-vs-fastcgi-vs-php-fpm-for-web-server-scripting/
PHP ACCELERATORS
Alternative PHP Cache (APC)
Zend OPcache
XCache
apc.shm_size
apc.ttl
apc.num_files_hint
apc.gc_ttl
apc.max_file_size
apc.stat
APC
2Read: https://www.scalingphpbook.com/best-zend-opcache-settings-tuning-config/
DrupalCamp SP 2015 -  Escalando PHP e Drupal- Performance ao infinito e além!
● Is PHP really your bottleneck?
● Same memory, less CPU
● Great for authenticated users.
● Some problems with NGINX (solvable!)
● Great resume: http://alexrayu.com/blog/drupal-hhvm
Scaling Drupal
Horizontally
(“Cattles, not Pets”)
Points of Attention
● Session
● Files
● Database
● Authenticated Users
Authenticated Users
- AuthCache contrib module
- Memcache
- AJAX
Database
- MySQL Read Replicas
+ AutoSlave contrib module
+ Orbital Cache Nuke (OCN)
Files
- Rsync bi-directional replication
- NFS shared mount
- Cloud-based solution (S3/GCS)
Session
- Drupal handes it beautifully
- Session is stored on Database
- Memcache to cache tables
Avoid database specific
queries.
Use Drupal`s built-in
Database API whenever
possible!
Avoid db_query(), always
prefer specific functions.
And choose well
your database!!
● MySQL
● MariaDB
● PerconaDB
Version?!
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!
How dependent of your actual
environment are you?
timezonepaths connection string
limits
timeouts
Number of triesAPI Keys
Caching Mechanisms
Redis
Specially useful for entities
Memcache
for key/value storage
URI -> HTML output, Session data
tmpfs/ramfs
for all filesystem (I/O intensive) based
caching like Boost.
Use Drupal’s
built-in
Cache API
Reverse proxy caching
Nginx Varnish
Some modules that
break reverse caching
Adaptive Image - Since it detects browser to serve
image the reverse proxy will cache the first
occurence.
Text Size - Use cookies to store user choosen size.
Recaptcha - Use cookie to store valid challenge.
Key phrases:
“Depends on cookies”
“Browser detection”
DrupalCamp SP 2015 -  Escalando PHP e Drupal- Performance ao infinito e além!
Drupal Queue
API
Helpful Modules
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!
RULES!
:-D
https://www.drupal.org/project/httprl
https://www.drupal.org/project/httprl
Profiling is about Measuring!
XHProf
DrupalCamp SP 2015 -  Escalando PHP e Drupal- Performance ao infinito e além!
Q&A
ciandt.com
Presentation Deck
http://goo.gl/0cV1KT
THANKS
FOR
BEING
HERE!
Please evaluate this presentation!
http://goo.gl/P8ZDfc
(3 questions only)
@lunascarruda
drupal.org/u/larruda
lunascar@gmail.com
google.com/+LucasArruda
fb.com/lucasnarruda
linkedin.com/in/larruda
github.com/larruda
@handrus
drupal.org/u/handrus
handrus@gmail.com
google.com/+HandrusNogueira
fb.com/handrus
linkedin.com/in/handrus
github.com/handrus

More Related Content

What's hot (16)

PDF
High Performance Drupal
Chapter Three
 
PPTX
Performance Optimization in Drupal 8
valuebound
 
PPTX
Php
Muthuganesh S
 
ODP
Apache bigtopwg7142013
Doug Chang
 
PDF
Hong Kong Drupal User Group - Sep 13th
Wong Hoi Sing Edison
 
PPTX
Web profiler in drupal 8
valuebound
 
PDF
Zingme practice for building scalable website with PHP
Chau Thanh
 
PDF
Web Application Performance Audit and Optimization
Zyxware Technologies
 
PDF
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
Atwix
 
PDF
Hadoop spark online demo
Tripti Jha
 
PDF
WordCamp RVA 2011 - Performance & Tuning
Timothy Wood
 
PDF
HBaseCon2017 Efficient and portable data processing with Apache Beam and HBase
HBaseCon
 
PPTX
Introduction to Javascript
foOfys Solutions
 
PPTX
Hadoop in a Windows Shop - CHUG - 20120416
Chicago Hadoop Users Group
 
PPT
Intro ror
tim_tang
 
PPTX
CI_CONF 2012: Scaling
Chris Miller
 
High Performance Drupal
Chapter Three
 
Performance Optimization in Drupal 8
valuebound
 
Apache bigtopwg7142013
Doug Chang
 
Hong Kong Drupal User Group - Sep 13th
Wong Hoi Sing Edison
 
Web profiler in drupal 8
valuebound
 
Zingme practice for building scalable website with PHP
Chau Thanh
 
Web Application Performance Audit and Optimization
Zyxware Technologies
 
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
Atwix
 
Hadoop spark online demo
Tripti Jha
 
WordCamp RVA 2011 - Performance & Tuning
Timothy Wood
 
HBaseCon2017 Efficient and portable data processing with Apache Beam and HBase
HBaseCon
 
Introduction to Javascript
foOfys Solutions
 
Hadoop in a Windows Shop - CHUG - 20120416
Chicago Hadoop Users Group
 
Intro ror
tim_tang
 
CI_CONF 2012: Scaling
Chris Miller
 

Viewers also liked (18)

PPTX
Superando o GitFlow - DrupalCamp Campinas 2016
Taller Negócio Digitais
 
PPTX
Case Campanha de Vacinação FIESC/SESI SC
Taller Negócio Digitais
 
PDF
DrupalCamp SP 2015 - Vendendo a filosofia Open-Source (e Drupal!)
Taller Negócio Digitais
 
PPTX
Arquitetura de referência Drupal 7 e 8. Da Natura e Taller para a comunidade ...
Taller Negócio Digitais
 
PPTX
Os pecados mortais de escalabilidade em Drupal e seus efeitos nos negócios - ...
Taller Negócio Digitais
 
PDF
Selling the Open-Source Philosophy - DrupalCon Latin America
Taller Negócio Digitais
 
PDF
Taller talk - Site/blog 2.0
Taller Negócio Digitais
 
PPTX
Programação Eficaz - Agile Trends Floripa 2016
Taller Negócio Digitais
 
PPTX
A arte do começo- DrupalCamp Campinas 2016
Taller Negócio Digitais
 
PDF
The Art of Start - How to build a Drupal Shop with no money but with lots of ...
Taller Negócio Digitais
 
PPTX
Drupal 8 e ReactJS - DrupalCamp Campinas 2016
Taller Negócio Digitais
 
PDF
Trabalhando a cultura do feedback. Por onde começar?
Taller Negócio Digitais
 
PPTX
Kanban no fluxo único de portfolio de projetos
Taller Negócio Digitais
 
PDF
Drupal in South America
Taller Negócio Digitais
 
PPTX
Como a Natura vem diminuindo seu custo de operação total com Drupal - DrupalC...
Taller Negócio Digitais
 
PPTX
A importância da Transparência na cultura ágil
Taller Negócio Digitais
 
PDF
Lean Branding
Taller Negócio Digitais
 
PDF
Kanban no Fluxo Unificado de Portfolio de Projetos - Agile Brazil 2016
Taller Negócio Digitais
 
Superando o GitFlow - DrupalCamp Campinas 2016
Taller Negócio Digitais
 
Case Campanha de Vacinação FIESC/SESI SC
Taller Negócio Digitais
 
DrupalCamp SP 2015 - Vendendo a filosofia Open-Source (e Drupal!)
Taller Negócio Digitais
 
Arquitetura de referência Drupal 7 e 8. Da Natura e Taller para a comunidade ...
Taller Negócio Digitais
 
Os pecados mortais de escalabilidade em Drupal e seus efeitos nos negócios - ...
Taller Negócio Digitais
 
Selling the Open-Source Philosophy - DrupalCon Latin America
Taller Negócio Digitais
 
Taller talk - Site/blog 2.0
Taller Negócio Digitais
 
Programação Eficaz - Agile Trends Floripa 2016
Taller Negócio Digitais
 
A arte do começo- DrupalCamp Campinas 2016
Taller Negócio Digitais
 
The Art of Start - How to build a Drupal Shop with no money but with lots of ...
Taller Negócio Digitais
 
Drupal 8 e ReactJS - DrupalCamp Campinas 2016
Taller Negócio Digitais
 
Trabalhando a cultura do feedback. Por onde começar?
Taller Negócio Digitais
 
Kanban no fluxo único de portfolio de projetos
Taller Negócio Digitais
 
Drupal in South America
Taller Negócio Digitais
 
Como a Natura vem diminuindo seu custo de operação total com Drupal - DrupalC...
Taller Negócio Digitais
 
A importância da Transparência na cultura ágil
Taller Negócio Digitais
 
Kanban no Fluxo Unificado de Portfolio de Projetos - Agile Brazil 2016
Taller Negócio Digitais
 
Ad

Similar to DrupalCamp SP 2015 - Escalando PHP e Drupal- Performance ao infinito e além! (20)

PDF
InterConPHP 2014 - Scaling PHP
Lucas Arruda
 
PPT
Drupalcamp Estonia - High Performance Sites
Exove
 
PDF
Scaling php - Intercon php
Handrus Nogueira
 
PDF
Beat the devil: towards a Drupal performance benchmark
Pedro González Serrano
 
PPTX
Drupal performance
Piyuesh Kumar
 
PPTX
Pure Speed Drupal 4 Gov talk
Bryan Ollendyke
 
PPT
Performance and Scalability
Mediacurrent
 
PDF
Drupal 7 performance and optimization
Shafqat Hussain
 
PDF
Scaling in Mind (Case study of Drupal Core)
jimyhuang
 
PDF
Scale Apache with Nginx
Bud Siddhisena
 
PDF
Drupal Performance : DrupalCamp North
Philip Norton
 
PDF
Drupal performance and scalability
Twinbit
 
PPTX
Drupal Development Tips
Chris Tankersley
 
ODP
Speeding up your Drupal site
Ronan Berder
 
PDF
Scaling with Symfony - PHP UK
Ricard Clau
 
PDF
2013 - Dustin whittle - Escalando PHP en la vida real
PHP Conference Argentina
 
PDF
Drupal - it all comes down to performance
Janis Janovskis
 
PPTX
Drupal Backend Performance and Scalability
Ashok Modi
 
PDF
High Performance Drupal
Jeff Geerling
 
PPT
Speeding Up The Snail
Marcus Deglos
 
InterConPHP 2014 - Scaling PHP
Lucas Arruda
 
Drupalcamp Estonia - High Performance Sites
Exove
 
Scaling php - Intercon php
Handrus Nogueira
 
Beat the devil: towards a Drupal performance benchmark
Pedro González Serrano
 
Drupal performance
Piyuesh Kumar
 
Pure Speed Drupal 4 Gov talk
Bryan Ollendyke
 
Performance and Scalability
Mediacurrent
 
Drupal 7 performance and optimization
Shafqat Hussain
 
Scaling in Mind (Case study of Drupal Core)
jimyhuang
 
Scale Apache with Nginx
Bud Siddhisena
 
Drupal Performance : DrupalCamp North
Philip Norton
 
Drupal performance and scalability
Twinbit
 
Drupal Development Tips
Chris Tankersley
 
Speeding up your Drupal site
Ronan Berder
 
Scaling with Symfony - PHP UK
Ricard Clau
 
2013 - Dustin whittle - Escalando PHP en la vida real
PHP Conference Argentina
 
Drupal - it all comes down to performance
Janis Janovskis
 
Drupal Backend Performance and Scalability
Ashok Modi
 
High Performance Drupal
Jeff Geerling
 
Speeding Up The Snail
Marcus Deglos
 
Ad

More from Taller Negócio Digitais (20)

PPTX
Indo além do técnico para desenvolver sistemas que evoluem na velocidade do...
Taller Negócio Digitais
 
PPTX
Discovery kanban
Taller Negócio Digitais
 
PDF
Taller Negócios Digitais
Taller Negócio Digitais
 
PDF
De um sistema legado para micro serviços com GraphQL
Taller Negócio Digitais
 
PDF
Next.js with drupal, the good parts
Taller Negócio Digitais
 
PPTX
Gestão Ágil com Fluxo Unificado
Taller Negócio Digitais
 
PDF
Alinhando Discovery com Delivery usando Upstream Kanban
Taller Negócio Digitais
 
PDF
Lições Aprendidas com Fluxo Unificado
Taller Negócio Digitais
 
PDF
Como a liderança descentralizada tornou a Taller mais efetiva
Taller Negócio Digitais
 
PDF
Métricas no Fluxo Unificado
Taller Negócio Digitais
 
PDF
Práticas e ferramentas de feedback: potencializando a cultura da confiança
Taller Negócio Digitais
 
PDF
Como preparar seu time para receber feedback - Scrum Gathering Rio 2017
Taller Negócio Digitais
 
PDF
Vacinando mais de 200 mil pessoas com ReactJS e GraphQL
Taller Negócio Digitais
 
PDF
Taller – Treinamentos e consultorias
Taller Negócio Digitais
 
PDF
Taller - Ateliê de desenvolvimento de software
Taller Negócio Digitais
 
PDF
Introdução ao Fluxo Unificado - TDC Florianópolis 2017
Taller Negócio Digitais
 
PDF
Javascript Funcional - TDC Florianópolis 2017
Taller Negócio Digitais
 
PDF
11 maneiras de compartilhar conhecimento - TDC Florianópolis 2017
Taller Negócio Digitais
 
PPTX
A importância da transparência na cultura ágil - 2º Agile Floripa
Taller Negócio Digitais
 
PPTX
Kanban no Fluxo Único - sessão Show me your board, Agile Trends 2016
Taller Negócio Digitais
 
Indo além do técnico para desenvolver sistemas que evoluem na velocidade do...
Taller Negócio Digitais
 
Discovery kanban
Taller Negócio Digitais
 
Taller Negócios Digitais
Taller Negócio Digitais
 
De um sistema legado para micro serviços com GraphQL
Taller Negócio Digitais
 
Next.js with drupal, the good parts
Taller Negócio Digitais
 
Gestão Ágil com Fluxo Unificado
Taller Negócio Digitais
 
Alinhando Discovery com Delivery usando Upstream Kanban
Taller Negócio Digitais
 
Lições Aprendidas com Fluxo Unificado
Taller Negócio Digitais
 
Como a liderança descentralizada tornou a Taller mais efetiva
Taller Negócio Digitais
 
Métricas no Fluxo Unificado
Taller Negócio Digitais
 
Práticas e ferramentas de feedback: potencializando a cultura da confiança
Taller Negócio Digitais
 
Como preparar seu time para receber feedback - Scrum Gathering Rio 2017
Taller Negócio Digitais
 
Vacinando mais de 200 mil pessoas com ReactJS e GraphQL
Taller Negócio Digitais
 
Taller – Treinamentos e consultorias
Taller Negócio Digitais
 
Taller - Ateliê de desenvolvimento de software
Taller Negócio Digitais
 
Introdução ao Fluxo Unificado - TDC Florianópolis 2017
Taller Negócio Digitais
 
Javascript Funcional - TDC Florianópolis 2017
Taller Negócio Digitais
 
11 maneiras de compartilhar conhecimento - TDC Florianópolis 2017
Taller Negócio Digitais
 
A importância da transparência na cultura ágil - 2º Agile Floripa
Taller Negócio Digitais
 
Kanban no Fluxo Único - sessão Show me your board, Agile Trends 2016
Taller Negócio Digitais
 

Recently uploaded (20)

PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Biography of Daniel Podor.pdf
Daniel Podor
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 

DrupalCamp SP 2015 - Escalando PHP e Drupal- Performance ao infinito e além!