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

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 

Recently uploaded (20)

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 

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