SlideShare a Scribd company logo
Scaling WordPress
Joseph Scott
http://josephscott.org
Lessons From
WordPress.com
http://en.wordpress.com/stats/
Reading on WordPress.com
Over 372 million people view
more than 4.1 billion pages each month.
http://en.wordpress.com/stats/
Publishing on WordPress.com
about 49.3 million new posts and
50.7 million new comments each month
http://en.wordpress.com/stats/
Scaling WordPress
Start Small
Layers
Network
Server Hardware
Operating System
Layers
Network
Server Hardware
Operating System
HTTP PHP MySQL
Layers
Network
Server Hardware
Operating System
HTTP PHP MySQL
WordPress
Layers
Network
Server Hardware
Operating System
HTTP PHP MySQL
WordPress
HTTP - Apache
‣Remove unused modules
‣Turn off host name lookups
‣Turn off .htaccess
‣Turn on compression
‣Tweak MaxClients
HTTP
Try Nginx
http://nginx.org/
PHP
๏ Use an opcode cache ( APC, Zend Opcache )
๏ Use newer versions
๏ Don’t use on static files
๏ Be careful with preg_* functions
๏ Profile your code ( Xdebug,VLD, XHProf )
๏ Don’t re-invent native PHP functions
MySQL
๏ Use InnoDB,
unless you have a good reason not to
๏ Use the slow query log
๏ Use EXPLAIN on queries,
learn what the output means
๏ Double Triple check your indexes
๏ Learn about quirks
MySQL
Not Just MySQL Any More
MySQL
WordPress
๏Turn off unused plugins
๏ Use a caching plugin
๏ Carefully vet themes and plugins
they have great powers
๏ Profile real life performance
Front End Performance
stevesouders.com
Track Performance
Forget about averages
Track Performance
Forget about averages
Averages Lie!
Track Performance
“Thinking Clearly About Performance”
- Cary Millsap
http://method-r.com/downloads/doc_details/44-thinking-
clearly-about-performance
Making Things Better
First, KnowYour Limits
First, KnowYour Limits
Determine the theoretical best performance
for your setup
First, KnowYour Limits
Determine the theoretical best performance
for your setup
What ever you come up with
will be slower than that
Less Work > More Work
PHP - opcode caching
Read Parse Compile Execute Output
.php
PHP - opcode caching
Read Parse Compile Execute Output
.php
APC
Opcode Cache
PHP - opcode caching
Reduce time per request by 4x
Increase requests per second by 4x
Less work, for the same result
means more capacity
Memcached
Key /Value data storage
In memory only, won’t survive a reboot
http://memcached.org/
WordPress + Memcached
WordPress Object Cache,
reduces the number of database queries
http://wordpress.org/extend/plugins/memcached/
Layers
HTTP PHP MySQL
WordPress
Memcached
WordPress + Memcached
+ Batcache
Stores & serve fully rendered pages
in Memcached
http://wordpress.org/extend/plugins/batcache/
Layers
HTTP PHP MySQL
WordPress
Memcached
Batcache
Servers
MySQL, Nginx, PHP-FPM,
Memcached
Servers
web
mysql
memcached
Servers
But my one database server
still can’t keep up
MySQL Replication
Master / Slave
๏ One way, asynchronous
๏Writes to the master
๏ Reads to the slave
๏ Multiple slaves & chaining
WordPress + HyperDB
Makes WordPress aware of
MySQL replication
http://wordpress.org/extend/plugins/hyperdb/
WordPress + HyperDB
๏ Read & write servers
๏ Priority for reads & writes
๏ Local and remote data centers
๏ Private and public networks
๏ Per table granularity
๏ Smart post-write master reads
Servers
web
mysql
memcached
mysql
writes
reads replication
MySQL Replication
Other Uses
๏ Slave just for backups
๏ Multiple data centers
๏Task specific web servers
Servers
load
balancer
web1
memcached1
replication
web2
web3
mysql1 mysql2
memcached2
Servers
Imagine all of that with:
๏ Multiple load balancers
๏ Multiple networks ( public / private )
๏ Multiple data centers
One More Thing
Asynchronous Jobs Queue
Lots of options
We built one for WordPress.com
Asynchronous Jobs Queue
http://code.trac.wordpress.org/browser/jobs
http://code.trac.wordpress.org/wiki/JobsDocs
All PHP + MySQL
Asynchronous Jobs Queue
Good for anything that isn’t
required for rendering a page
Questions?
Joseph Scott
http://josephscott.org/
joseph@josephscott.org
@josephscott

More Related Content

What's hot (20)

ODP
Making dynamic sites scale like static sites
Wim Godden
 
PDF
EasyEngine - Command-Line tool to manage WordPress Sites on Nginx
rtCamp
 
ODP
Remove web calls and scale your site like crazy !
Wim Godden
 
PPT
High Performance Wordpress
Gareth Davies
 
PPTX
Building Scalable Web Apps - LVL.UP KL
Gareth Davies
 
PPTX
AEM WITH MONGODB
Nate Nelson
 
ZIP
High Performance WordPress - WordCamp Jerusalem 2010
Barry Abrahamson
 
PDF
Seravo.com: WordPress Security 101
Seravo
 
PPTX
Speed up Your Joomla Site for Ultimate Performance
JoomlaDay Australia
 
PDF
High Performance WordPress
vnsavage
 
PPT
Roy foubister (hosting high traffic sites on a tight budget)
WordCamp Cape Town
 
PDF
WordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
topher1kenobe
 
PDF
Debugging WordPress Performance using EasyEngine
rtCamp
 
PPT
WebSockets and Java
Bozhidar Bozhanov
 
ODP
WP Sandbox Presentation WordCamp Toronto 2011
Alfred Ayache
 
PPTX
WordPress.org & Optimizing Security for your WordPress sites
GovLoop
 
PDF
Redundancy Rocks. Redundancy Rocks.
AOE
 
PDF
Super performing websites with TYPO3 and Varnish
christianjul
 
PDF
T3DD12 Caching with Varnish
AOE
 
PDF
Server Side Apocalypse, JS
Md. Sohel Rana
 
Making dynamic sites scale like static sites
Wim Godden
 
EasyEngine - Command-Line tool to manage WordPress Sites on Nginx
rtCamp
 
Remove web calls and scale your site like crazy !
Wim Godden
 
High Performance Wordpress
Gareth Davies
 
Building Scalable Web Apps - LVL.UP KL
Gareth Davies
 
AEM WITH MONGODB
Nate Nelson
 
High Performance WordPress - WordCamp Jerusalem 2010
Barry Abrahamson
 
Seravo.com: WordPress Security 101
Seravo
 
Speed up Your Joomla Site for Ultimate Performance
JoomlaDay Australia
 
High Performance WordPress
vnsavage
 
Roy foubister (hosting high traffic sites on a tight budget)
WordCamp Cape Town
 
WordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
topher1kenobe
 
Debugging WordPress Performance using EasyEngine
rtCamp
 
WebSockets and Java
Bozhidar Bozhanov
 
WP Sandbox Presentation WordCamp Toronto 2011
Alfred Ayache
 
WordPress.org & Optimizing Security for your WordPress sites
GovLoop
 
Redundancy Rocks. Redundancy Rocks.
AOE
 
Super performing websites with TYPO3 and Varnish
christianjul
 
T3DD12 Caching with Varnish
AOE
 
Server Side Apocalypse, JS
Md. Sohel Rana
 

Similar to Scaling WordPress (20)

KEY
Site Performance - From Pinto to Ferrari
Joseph Scott
 
PPTX
A crash course in scaling wordpress
GovLoop
 
PDF
High Performance WordPress II
Barry Abrahamson
 
PDF
Optimizing WordPress for Performance - WordCamp Houston
Chris Olbekson
 
ODP
Scalable Architecture 101
Mike Willbanks
 
PDF
Screaming Fast Wpmu
djcp
 
PPT
FOWA Scaling The Lamp Stack Workshop
dlieberman
 
PPT
Apache Con 2008 Top 10 Mistakes
John Coggeshall
 
PPT
Top 10 Scalability Mistakes
John Coggeshall
 
PPTX
Scaling wordpress for high traffic
Roshan Bhattarai
 
PDF
Roshan Bhattarai: Scaling WordPress for high traffic sites
wpnepal
 
PPTX
WordPress Performance
dsero
 
PDF
Improve WordPress performance with caching and deferred execution of code
Danilo Ercoli
 
PPT
Top 30 Scalability Mistakes
John Coggeshall
 
PDF
Zingme practice for building scalable website with PHP
Võ Duy Tuấn
 
PDF
Zingme practice for building scalable website with PHP
Chau Thanh
 
PDF
01 zingme practice for building scalable website with php
Nguyen Duc Phu
 
PDF
zingmepracticeforbuildingscalablewebsitewithphp
hazzaz
 
PPTX
Anthony Somerset - Site Speed = Success!
WordCamp Cape Town
 
PPT
Web Performance & Scalability Tools
Folio3 Software
 
Site Performance - From Pinto to Ferrari
Joseph Scott
 
A crash course in scaling wordpress
GovLoop
 
High Performance WordPress II
Barry Abrahamson
 
Optimizing WordPress for Performance - WordCamp Houston
Chris Olbekson
 
Scalable Architecture 101
Mike Willbanks
 
Screaming Fast Wpmu
djcp
 
FOWA Scaling The Lamp Stack Workshop
dlieberman
 
Apache Con 2008 Top 10 Mistakes
John Coggeshall
 
Top 10 Scalability Mistakes
John Coggeshall
 
Scaling wordpress for high traffic
Roshan Bhattarai
 
Roshan Bhattarai: Scaling WordPress for high traffic sites
wpnepal
 
WordPress Performance
dsero
 
Improve WordPress performance with caching and deferred execution of code
Danilo Ercoli
 
Top 30 Scalability Mistakes
John Coggeshall
 
Zingme practice for building scalable website with PHP
Võ Duy Tuấn
 
Zingme practice for building scalable website with PHP
Chau Thanh
 
01 zingme practice for building scalable website with php
Nguyen Duc Phu
 
zingmepracticeforbuildingscalablewebsitewithphp
hazzaz
 
Anthony Somerset - Site Speed = Success!
WordCamp Cape Town
 
Web Performance & Scalability Tools
Folio3 Software
 
Ad

More from Joseph Scott (7)

PDF
Site Testing with CasperJS
Joseph Scott
 
PDF
Python & FUSE
Joseph Scott
 
PDF
Improving Front End Performance
Joseph Scott
 
KEY
Anatomy of a PHP Request ( UTOSC 2010 )
Joseph Scott
 
PDF
WordPress APIs
Joseph Scott
 
PDF
WordPress Performance & Scalability
Joseph Scott
 
PDF
WordPress APIs
Joseph Scott
 
Site Testing with CasperJS
Joseph Scott
 
Python & FUSE
Joseph Scott
 
Improving Front End Performance
Joseph Scott
 
Anatomy of a PHP Request ( UTOSC 2010 )
Joseph Scott
 
WordPress APIs
Joseph Scott
 
WordPress Performance & Scalability
Joseph Scott
 
WordPress APIs
Joseph Scott
 
Ad

Recently uploaded (20)

PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
Shuen Mei Parth Sharma Boost Productivity, Innovation and Efficiency wit...
AWS Chicago
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
PDF
UiPath vs Other Automation Tools Meeting Presentation.pdf
Tracy Dixon
 
PDF
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PPTX
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Arcee AI - building and working with small language models (06/25)
Julien SIMON
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
Darren Mills The Migration Modernization Balancing Act: Navigating Risks and...
AWS Chicago
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PDF
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
PDF
Rethinking Security Operations - SOC Evolution Journey.pdf
Haris Chughtai
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
Shuen Mei Parth Sharma Boost Productivity, Innovation and Efficiency wit...
AWS Chicago
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
UiPath vs Other Automation Tools Meeting Presentation.pdf
Tracy Dixon
 
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Arcee AI - building and working with small language models (06/25)
Julien SIMON
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Darren Mills The Migration Modernization Balancing Act: Navigating Risks and...
AWS Chicago
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
Rethinking Security Operations - SOC Evolution Journey.pdf
Haris Chughtai
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 

Scaling WordPress