SlideShare a Scribd company logo
1 of 48
Download to read offline
WordPress
Performance & Scalability

            Joseph Scott
       http://josephscott.org/
Find Me

• http://josephscott.org/
• joseph@josephscott.org
• http://twitter.com/josephscott/
• #wordpress-dev
Backup First
Performance




Shelby Supercars Ultimate Aero Twin Turbo
Scalability
Web Apps Are Like
 Ogres Onions
Start At The Bottom
       Deal with network
       problems / bottlenecks
       first

       Be familiar with Operating
       System network
       optimizations
Web Server


  Apache?
Web Server
nginx                           LiteSpeed
http://nginx.net/               http://litespeedtech.com/




     lighttpd                        Zeus
     http://www.lighttpd.net/        http://www.zeus.com/
Apache
• Can be a pig, remove any modules you aren’t
  using
• Turn off host name lookups
• Turn on compression (mod_deflate)
• Turn off FollowSymLinks (and .htaccess if you
  can)
• Skip Apache all together, serve static content
  from another server
PHP
• Use an opcode cache (APC, lots of others)
• Don’t use on static files (unless you really,
  really need to)
• Consider output buffering
• Be careful with preg_* functions
MySQL - Table Types
MyISAM
• High performance reads or writes, not
  both
• Full text search
InnoDB
• Better for mixed reads/writes
• Transactions, Foreign Keys
MySQL
• Double (and triple) check indexes
• Tune your configuration
  • key_buffer_size, table_cache,
    sort_buffer_size, read_buffer_size
• Replication (more on that later)
• Interesting quirks, get familiar with them
Memcache

In memory object cache, learn it, use it, love it


                 With Caution
WordPress
• MySQL tables default to using MyISAM,
  consider using InnoDB instead
• Turn off unused plugins
• Check that themes and plugins aren’t abusing
  MySQL or PHP
• Server static content from another server
  (optimized for that task)
Construction

     Start from the bottom and
     work your way up
Test Setup
• Ubuntu 9.04 server edition
• Apache 2.2.11
• PHP 5.2.6
• MySQL 5.0.75
• WordPress -trunk
Test “Hardware”

Parallels 4.0
     2.66 Xeon
     1 GB Ram
Abusing The Server
siege - http://www.joedog.org/index/siege-home

   siege -d 1 -c 50 -r 10 http://192.168.1.100/
Below The Baseline

Zero Byte HTML - zero.html
              (80 r/s) ~0.01 s/r

  Zero Byte PHP - zero.php
              (80 r/s) ~0.01 s/r
a phpinfo( )’s worth
                        51,213 / 8,689 bytes




static HTML - phpinfo.html
         100% (75 r/s) ~0.04 s/r

        PHP - phpinfo.php
          92% (69 r/s) ~0.04 s/r
Hello World!
              6,582 / 2,531 bytes




WordPress: /wp/?p=1
Hello World!
                 6,582 / 2,531 bytes




WordPress: /wp/?p=1
        8% (6 r/s) ~7 s/r
Hello World!
   + APC
WordPress: /wp/?p=1
    29% (22 r/s) ~1.51 s/r
Use An Opcode Cache!
  %8 ~7     %29 ~1.51
Use An Opcode Cache!
  %8 ~7     %29 ~1.51
WordPress + Memcache

• Ryan Boren
• Stores WordPress data in Memcache
• Reduces the number of database queries
• http://ryan.wordpress.com/2005/12/23/
  memcached-backend/
Hello World!
+ APC + Memcache
 WordPress: /wp/?p=1
      32% (24 r/s) ~1.4 s/r
Batcache!
WordPress + Batcache

• Andy Skelton
• Stores rendered HTML in Memcache
• http://wordpress.org/extend/plugins/batcache/
Hello World! + APC +
Memcache + Batcache
 WordPress: /wp/?p=1
      80% (60 r/s) ~0.4 s/r
Hello World! + APC +
Memcache + Batcache
WordPress
     + WP Super Cache
• Donncha O Caoimh
• Stores rendered HTML on disk
• http://wordpress.org/extend/plugins/wp-super-
  cache/
Let me 'splain. ...
No, there is too much. Let me sum up.
                     Requests Seconds per
   Description                                  Potential
                    per Second request (mean)
Zero Bytes              80         ~0.01                  -
Static phpinfo()        75         ~0.04              100%
phpinfo()               69         ~0.04               92%
OOB WP                   6         ~7.00                8%
WP & APC                22         ~1.51               29%
WP & APC/
                        24         ~1.40               32%
Memcache
WP & APC/
                        60         ~0.04               80%
Memcache/Batcache
What Now?
All In One



 Web / Database
Moving Out


Web         Database
Paying In Cache

           Web

Memcache         Database
But Wait, There’s More!
MySQL Replication
• Master / Slave - one way asynchronous
• Send writes to the master, reads to the
  slave(s)
• Replication works on both MyISAM and
  InnoDB tables
• Supports multiple slaves and replication
  chaining
Enter HyperDB
• Drop in replacement for the default
  WordPress database class
• Supports distributed reads/writes
• Partition data (helpful for large WPMU
  installs)
• Failover support when a database goes down
• http://codex.wordpress.org/HyperDB
Replicated Data

                    DB Master
           Web

Memcache
                    DB Slave
A Balancing Act
                Load Balancer




Web 1   Web 2        Web 3
Variations on a Theme

• Master / Relay / Slave
• Slave just for backups
• Multiple data centers
• Task specific web servers
When Everything Goes
      Wrong
Hire An Amazing
   SysAdmin
Thank You
Find Me

• http://josephscott.org/
• joseph@josephscott.org
• http://twitter.com/josephscott/
• #wordpress-dev

More Related Content

What's hot

快快樂樂用Homestead
快快樂樂用Homestead快快樂樂用Homestead
快快樂樂用HomesteadChen Cheng-Wei
 
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...Alexander Lisachenko
 
EasyEngine - Command-Line tool to manage WordPress Sites on Nginx
EasyEngine - Command-Line tool to manage WordPress Sites on NginxEasyEngine - Command-Line tool to manage WordPress Sites on Nginx
EasyEngine - Command-Line tool to manage WordPress Sites on NginxrtCamp
 
Virtual Infrastructure
Virtual InfrastructureVirtual Infrastructure
Virtual InfrastructureBryan McLellan
 
Memcached B box presentation
Memcached B box presentationMemcached B box presentation
Memcached B box presentationNagesh Chinkeri
 
Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)WordCamp Cape Town
 
High performance WordPress
High performance WordPressHigh performance WordPress
High performance WordPressMikel King
 
Performance all teh things
Performance all teh thingsPerformance all teh things
Performance all teh thingsMarcus Deglos
 
Zend Con 2008 Slides
Zend Con 2008 SlidesZend Con 2008 Slides
Zend Con 2008 Slidesmkherlakian
 
2008 MySQL Conference Recap
2008 MySQL Conference Recap2008 MySQL Conference Recap
2008 MySQL Conference RecapChris Barber
 
Magento performance
Magento performanceMagento performance
Magento performanceDivante
 
Setting up a local WordPress Environment
Setting up a local WordPress EnvironmentSetting up a local WordPress Environment
Setting up a local WordPress EnvironmentChris La Nauze
 
Memcache basics on google app engine
Memcache basics on google app engineMemcache basics on google app engine
Memcache basics on google app engineIdo Green
 
High Performance Wordpress: “Faster, Cheaper, Easier : Pick Three”
High Performance Wordpress: “Faster, Cheaper, Easier : Pick Three”High Performance Wordpress: “Faster, Cheaper, Easier : Pick Three”
High Performance Wordpress: “Faster, Cheaper, Easier : Pick Three”Valent Mustamin
 
Magento caching
Magento cachingMagento caching
Magento cachingYireo
 

What's hot (20)

WebSockets and Java
WebSockets and JavaWebSockets and Java
WebSockets and Java
 
快快樂樂用Homestead
快快樂樂用Homestead快快樂樂用Homestead
快快樂樂用Homestead
 
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
 
EasyEngine - Command-Line tool to manage WordPress Sites on Nginx
EasyEngine - Command-Line tool to manage WordPress Sites on NginxEasyEngine - Command-Line tool to manage WordPress Sites on Nginx
EasyEngine - Command-Line tool to manage WordPress Sites on Nginx
 
體驗 Hhvm
體驗 Hhvm體驗 Hhvm
體驗 Hhvm
 
Apache
ApacheApache
Apache
 
Virtual Infrastructure
Virtual InfrastructureVirtual Infrastructure
Virtual Infrastructure
 
Memcached B box presentation
Memcached B box presentationMemcached B box presentation
Memcached B box presentation
 
Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)
 
High performance WordPress
High performance WordPressHigh performance WordPress
High performance WordPress
 
Performance all teh things
Performance all teh thingsPerformance all teh things
Performance all teh things
 
Web sockets in Java
Web sockets in JavaWeb sockets in Java
Web sockets in Java
 
Zend Con 2008 Slides
Zend Con 2008 SlidesZend Con 2008 Slides
Zend Con 2008 Slides
 
2008 MySQL Conference Recap
2008 MySQL Conference Recap2008 MySQL Conference Recap
2008 MySQL Conference Recap
 
Mysql S&M
Mysql S&MMysql S&M
Mysql S&M
 
Magento performance
Magento performanceMagento performance
Magento performance
 
Setting up a local WordPress Environment
Setting up a local WordPress EnvironmentSetting up a local WordPress Environment
Setting up a local WordPress Environment
 
Memcache basics on google app engine
Memcache basics on google app engineMemcache basics on google app engine
Memcache basics on google app engine
 
High Performance Wordpress: “Faster, Cheaper, Easier : Pick Three”
High Performance Wordpress: “Faster, Cheaper, Easier : Pick Three”High Performance Wordpress: “Faster, Cheaper, Easier : Pick Three”
High Performance Wordpress: “Faster, Cheaper, Easier : Pick Three”
 
Magento caching
Magento cachingMagento caching
Magento caching
 

Viewers also liked

State of Drupal keynote, DrupalCon Dublin
State of Drupal keynote, DrupalCon DublinState of Drupal keynote, DrupalCon Dublin
State of Drupal keynote, DrupalCon DublinDries Buytaert
 
TYPO3 Scalability for high traffic sites
TYPO3 Scalability for high traffic sitesTYPO3 Scalability for high traffic sites
TYPO3 Scalability for high traffic sitesdanospv
 
Xitrum HOWTOs
Xitrum HOWTOsXitrum HOWTOs
Xitrum HOWTOsNgoc Dao
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Ngoc Dao
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumNgoc Dao
 
How to write a web framework
How to write a web frameworkHow to write a web framework
How to write a web frameworkNgoc Dao
 

Viewers also liked (6)

State of Drupal keynote, DrupalCon Dublin
State of Drupal keynote, DrupalCon DublinState of Drupal keynote, DrupalCon Dublin
State of Drupal keynote, DrupalCon Dublin
 
TYPO3 Scalability for high traffic sites
TYPO3 Scalability for high traffic sitesTYPO3 Scalability for high traffic sites
TYPO3 Scalability for high traffic sites
 
Xitrum HOWTOs
Xitrum HOWTOsXitrum HOWTOs
Xitrum HOWTOs
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
 
How to write a web framework
How to write a web frameworkHow to write a web framework
How to write a web framework
 

Similar to WordPress Performance & Scalability

Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariJoseph Scott
 
Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Wim Godden
 
PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + MemcachedFord AntiTrust
 
Caching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTourCaching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTourWim Godden
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Wim Godden
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalabilityWim Godden
 
Apache and PHP: Why httpd.conf is your new BFF!
Apache and PHP: Why httpd.conf is your new BFF!Apache and PHP: Why httpd.conf is your new BFF!
Apache and PHP: Why httpd.conf is your new BFF!Jeff Jones
 
Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011Wim Godden
 
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for WindowsFord AntiTrust
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalabilityWim Godden
 
WP Sandbox Presentation WordCamp Toronto 2011
WP Sandbox Presentation WordCamp Toronto 2011WP Sandbox Presentation WordCamp Toronto 2011
WP Sandbox Presentation WordCamp Toronto 2011Alfred Ayache
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalabilityWim Godden
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - DeploymentFabio Akita
 
php & performance
 php & performance php & performance
php & performancesimon8410
 
Northeast PHP - High Performance PHP
Northeast PHP - High Performance PHPNortheast PHP - High Performance PHP
Northeast PHP - High Performance PHPJonathan Klein
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APCBen Ramsey
 
Performance and Scalability
Performance and ScalabilityPerformance and Scalability
Performance and ScalabilityMediacurrent
 
MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011Mike Willbanks
 

Similar to WordPress Performance & Scalability (20)

Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012
 
PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + Memcached
 
Caching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTourCaching and tuning fun for high scalability @ PHPTour
Caching and tuning fun for high scalability @ PHPTour
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011
 
Memcached Study
Memcached StudyMemcached Study
Memcached Study
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Apache and PHP: Why httpd.conf is your new BFF!
Apache and PHP: Why httpd.conf is your new BFF!Apache and PHP: Why httpd.conf is your new BFF!
Apache and PHP: Why httpd.conf is your new BFF!
 
Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011Caching and tuning fun for high scalability @ phpBenelux 2011
Caching and tuning fun for high scalability @ phpBenelux 2011
 
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
WP Sandbox Presentation WordCamp Toronto 2011
WP Sandbox Presentation WordCamp Toronto 2011WP Sandbox Presentation WordCamp Toronto 2011
WP Sandbox Presentation WordCamp Toronto 2011
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Dev ops for developers
Dev ops for developersDev ops for developers
Dev ops for developers
 
php & performance
 php & performance php & performance
php & performance
 
Northeast PHP - High Performance PHP
Northeast PHP - High Performance PHPNortheast PHP - High Performance PHP
Northeast PHP - High Performance PHP
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APC
 
Performance and Scalability
Performance and ScalabilityPerformance and Scalability
Performance and Scalability
 
MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011
 

More from Joseph Scott

Site Testing with CasperJS
Site Testing with CasperJSSite Testing with CasperJS
Site Testing with CasperJSJoseph Scott
 
Improving Front End Performance
Improving Front End PerformanceImproving Front End Performance
Improving Front End PerformanceJoseph Scott
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Joseph Scott
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & ScalabilityJoseph Scott
 

More from Joseph Scott (7)

Site Testing with CasperJS
Site Testing with CasperJSSite Testing with CasperJS
Site Testing with CasperJS
 
Python & FUSE
Python & FUSEPython & FUSE
Python & FUSE
 
Improving Front End Performance
Improving Front End PerformanceImproving Front End Performance
Improving Front End Performance
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & Scalability
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 

Recently uploaded

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Recently uploaded (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

WordPress Performance & Scalability

  • 1. WordPress Performance & Scalability Joseph Scott http://josephscott.org/
  • 2. Find Me • http://josephscott.org/ • joseph@josephscott.org • http://twitter.com/josephscott/ • #wordpress-dev
  • 6. Web Apps Are Like Ogres Onions
  • 7. Start At The Bottom Deal with network problems / bottlenecks first Be familiar with Operating System network optimizations
  • 8. Web Server Apache?
  • 9. Web Server nginx LiteSpeed http://nginx.net/ http://litespeedtech.com/ lighttpd Zeus http://www.lighttpd.net/ http://www.zeus.com/
  • 10. Apache • Can be a pig, remove any modules you aren’t using • Turn off host name lookups • Turn on compression (mod_deflate) • Turn off FollowSymLinks (and .htaccess if you can) • Skip Apache all together, serve static content from another server
  • 11. PHP • Use an opcode cache (APC, lots of others) • Don’t use on static files (unless you really, really need to) • Consider output buffering • Be careful with preg_* functions
  • 12. MySQL - Table Types MyISAM • High performance reads or writes, not both • Full text search InnoDB • Better for mixed reads/writes • Transactions, Foreign Keys
  • 13. MySQL • Double (and triple) check indexes • Tune your configuration • key_buffer_size, table_cache, sort_buffer_size, read_buffer_size • Replication (more on that later) • Interesting quirks, get familiar with them
  • 14. Memcache In memory object cache, learn it, use it, love it With Caution
  • 15. WordPress • MySQL tables default to using MyISAM, consider using InnoDB instead • Turn off unused plugins • Check that themes and plugins aren’t abusing MySQL or PHP • Server static content from another server (optimized for that task)
  • 16. Construction Start from the bottom and work your way up
  • 17. Test Setup • Ubuntu 9.04 server edition • Apache 2.2.11 • PHP 5.2.6 • MySQL 5.0.75 • WordPress -trunk
  • 18. Test “Hardware” Parallels 4.0 2.66 Xeon 1 GB Ram
  • 19. Abusing The Server siege - http://www.joedog.org/index/siege-home siege -d 1 -c 50 -r 10 http://192.168.1.100/
  • 20. Below The Baseline Zero Byte HTML - zero.html (80 r/s) ~0.01 s/r Zero Byte PHP - zero.php (80 r/s) ~0.01 s/r
  • 21. a phpinfo( )’s worth 51,213 / 8,689 bytes static HTML - phpinfo.html 100% (75 r/s) ~0.04 s/r PHP - phpinfo.php 92% (69 r/s) ~0.04 s/r
  • 22. Hello World! 6,582 / 2,531 bytes WordPress: /wp/?p=1
  • 23. Hello World! 6,582 / 2,531 bytes WordPress: /wp/?p=1 8% (6 r/s) ~7 s/r
  • 24. Hello World! + APC WordPress: /wp/?p=1 29% (22 r/s) ~1.51 s/r
  • 25. Use An Opcode Cache! %8 ~7 %29 ~1.51
  • 26. Use An Opcode Cache! %8 ~7 %29 ~1.51
  • 27. WordPress + Memcache • Ryan Boren • Stores WordPress data in Memcache • Reduces the number of database queries • http://ryan.wordpress.com/2005/12/23/ memcached-backend/
  • 28. Hello World! + APC + Memcache WordPress: /wp/?p=1 32% (24 r/s) ~1.4 s/r
  • 30. WordPress + Batcache • Andy Skelton • Stores rendered HTML in Memcache • http://wordpress.org/extend/plugins/batcache/
  • 31. Hello World! + APC + Memcache + Batcache WordPress: /wp/?p=1 80% (60 r/s) ~0.4 s/r
  • 32. Hello World! + APC + Memcache + Batcache
  • 33. WordPress + WP Super Cache • Donncha O Caoimh • Stores rendered HTML on disk • http://wordpress.org/extend/plugins/wp-super- cache/
  • 34. Let me 'splain. ... No, there is too much. Let me sum up. Requests Seconds per Description Potential per Second request (mean) Zero Bytes 80 ~0.01 - Static phpinfo() 75 ~0.04 100% phpinfo() 69 ~0.04 92% OOB WP 6 ~7.00 8% WP & APC 22 ~1.51 29% WP & APC/ 24 ~1.40 32% Memcache WP & APC/ 60 ~0.04 80% Memcache/Batcache
  • 36. All In One Web / Database
  • 37. Moving Out Web Database
  • 38. Paying In Cache Web Memcache Database
  • 40. MySQL Replication • Master / Slave - one way asynchronous • Send writes to the master, reads to the slave(s) • Replication works on both MyISAM and InnoDB tables • Supports multiple slaves and replication chaining
  • 41. Enter HyperDB • Drop in replacement for the default WordPress database class • Supports distributed reads/writes • Partition data (helpful for large WPMU installs) • Failover support when a database goes down • http://codex.wordpress.org/HyperDB
  • 42. Replicated Data DB Master Web Memcache DB Slave
  • 43. A Balancing Act Load Balancer Web 1 Web 2 Web 3
  • 44. Variations on a Theme • Master / Relay / Slave • Slave just for backups • Multiple data centers • Task specific web servers
  • 46. Hire An Amazing SysAdmin
  • 48. Find Me • http://josephscott.org/ • joseph@josephscott.org • http://twitter.com/josephscott/ • #wordpress-dev