SlideShare a Scribd company logo
1 of 64
Download to read offline
TurboPress
The High Performance Guide to WordPress
Let’s start with
 some theory.
INTERWEBS AMIRITE?
Browser     sho velling



shovelling
             Web Server
                PHP
                           shovelling

             WordPress
shovelling
              MySQL
0. The Browser
1. DNS
 “ bethesignal.org ”


  Browser                 Router   ISP DNS
“ 70 . 85 . 31 . 216 “


                                   DNS Host
1. DNS
 “ bethesignal.org ”


  Browser                10 ms    Router   160 ms
                                                    ISP DNS
“ 70 . 85 . 31 . 216 “                                  210 ms



                                                    DNS Host
1. DNS
 “ bethesignal.org ”


  Browser                10 ms    Router     160 ms
                                                      ISP DNS
“ 70 . 85 . 31 . 216 “                                    210 ms



                                                      DNS Host

                                    Google’s web performance
                                    team calculate the average
                                     DNS query takes 130ms!
2. HTTP
 “ bethesignal.org “


  Browser                     10 ms    Router   160 ms
                                                         ISP DNS
“ 70 . 85 . 31 . 216 “                                       210 ms



                                                         DNS Host
    70 . 85 . 31 . 216 : 80


   Web Ser ver
2. HTTP
 “ bethesignal.org “


  Browser                       10 ms    Router   160 ms
                                                           ISP DNS
“ 70 . 85 . 31 . 216 “                                         210 ms


                       220 ms
                                                           DNS Host
    70 . 85 . 31 . 216 : 80


   Web Ser ver
3. PHP
 “ bethesignal.org “


  Browser                       10 ms    Router   160 ms
                                                           ISP DNS
“ 70 . 85 . 31 . 216 “                                         210 ms


                       220 ms
                                                           DNS Host
    70 . 85 . 31 . 216 : 80


   Web Ser ver                             PHP
3. PHP
 “ bethesignal.org “


  Browser                       10 ms            Router   160 ms
                                                                   ISP DNS
“ 70 . 85 . 31 . 216 “                                                 210 ms


                       220 ms
                                                                   DNS Host
    70 . 85 . 31 . 216 : 80
                                        650 ms


   Web Ser ver                                     PHP
4. MySQL
 “ bethesignal.org “


  Browser                       10 ms   Router   160 ms
                                                          ISP DNS
“ 70 . 85 . 31 . 216 “                                        210 ms


                       220 ms
                                                          DNS Host
    70 . 85 . 31 . 216 : 80


   Web Ser ver                            PHP             MySQL
5. Back to the browser!
Browser     sho velling



shovelling
             Web Server
                PHP
                           shovelling

             WordPress
shovelling
              MySQL
Some gory detail…
GET / HTTP/1.1
Host: bethesignal.org
Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11
(KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-AU,en;q=0.8,en-US;q=0.6
Accept-Charset: UTF-8,*;q=0.5
Cookie: wordpress_logged_in_...=jdub...
If-Modified-Since: Thu, 12 Jul 2012 21:27:06 GMT

HTTP/1.1 200 OK
Server: nginx/1.2.1
Date: Fri, 20 Jul 2012 23:48:04 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Vary: Cookie
X-Pingback: http://bethesignal.org/xmlrpc.php
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Last-Modified: Fri, 20 Jul 2012 23:48:03 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Pragma: no-cache
Content-Encoding: gzip
10:32:16.084565   *   About to connect() to bethesignal.org port 80 (#0)
10:32:16.084768   *     Trying 70.85.31.216... TCP_NODELAY set
10:32:16.283247   *   connected
10:32:16.283376   *   Connected to bethesignal.org (70.85.31.216) port 80 (#0)
10:32:16.283528   >   GET / HTTP/1.1
10:32:16.283528   >   User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/...
10:32:16.283528   >   Host: bethesignal.org
10:32:16.283528   >   Accept: */*
10:32:16.283528   >   Accept-Encoding: deflate, gzip
10:32:16.283528   >   Cookie: wordpress_logged_in_...=jdub...
10:32:16.283528   >
10:32:16.995103   <   HTTP/1.1 200 OK
10:32:16.995216   <   Server: nginx/1.2.1
10:32:16.995240   <   Date: Sat, 21 Jul 2012 00:32:16 GMT
10:32:16.995295   <   Content-Type: text/html; charset=UTF-8
10:32:16.995374   <   Transfer-Encoding: chunked
10:32:16.995412   <   Connection: keep-alive
10:32:16.995447   <   Vary: Accept-Encoding
10:32:16.995482   <   Vary: Cookie
10:32:16.995515   <   X-Pingback: http://bethesignal.org/xmlrpc.php
10:32:16.995548   <   Expires: Wed, 11 Jan 1984 05:00:00 GMT
10:32:16.995601   <   Last-Modified: Sat, 21 Jul 2012 00:32:16 GMT
10:32:16.995642   <   Cache-Control: no-cache, must-revalidate, max-age=0
10:32:16.995680   <   Pragma: no-cache
10:32:16.995717   <   Content-Encoding: gzip
10:32:16.995759   <
10:32:16.995794   {   [data not shown]
10:32:17.393072   *   Connection #0 to host bethesignal.org left intact
10:32:17.393170   *   Closing connection #0
Now you have
some <html> …
GET /wp-content/uploads/2011/04/strange-days.jpg HTTP/1.1
Host: bethesignal.org
Connection: keep-alive
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11
(KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://bethesignal.org/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-AU,en;q=0.8,en-US;q=0.6
Accept-Charset: UTF-8,*;q=0.5
Cookie: wordpress_logged_in_...=jdub...

HTTP/1.1 200 OK
Server: nginx/1.2.1
Date: Fri, 20 Jul 2012 23:50:50 GMT
Content-Type: image/jpeg
Content-Length: 180112
Last-Modified: Fri, 08 Apr 2011 14:25:27 GMT
Connection: keep-alive
Expires: Wed, 19 Jul 2017 23:50:50 GMT
Cache-Control: max-age=157680000
Accept-Ranges: bytes
10:34:05.051972   *   About to connect() to bethesignal.org port 80 (#0)
10:34:05.052162   *     Trying 70.85.31.216... TCP_NODELAY set
10:34:05.251898   *   connected
10:34:05.251989   *   Connected to bethesignal.org (70.85.31.216) port 80 (#0)
10:34:05.252123   >   GET /wp-content/uploads/2011/04/strange-days.jpg HTTP/1.1
10:34:05.252123   >   User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/...
10:34:05.252123   >   Host: bethesignal.org
10:34:05.252123   >   Accept: */*
10:34:05.252123   >   Accept-Encoding: deflate, gzip
10:34:05.252123   >   Cookie: wordpress_logged_in_...=jdub...
10:34:05.252123   >
10:34:05.448816   <   HTTP/1.1 200 OK
10:34:05.448981   <   Server: nginx/1.2.1
10:34:05.449045   <   Date: Sat, 21 Jul 2012 00:34:05 GMT
10:34:05.449091   <   Content-Type: image/jpeg
10:34:05.449131   <   Content-Length: 180112
10:34:05.449170   <   Last-Modified: Fri, 08 Apr 2011 14:25:27 GMT
10:34:05.449211   <   Connection: keep-alive
10:34:05.449250   <   Expires: Thu, 20 Jul 2017 00:34:05 GMT
10:34:05.449290   <   Cache-Control: max-age=157680000
10:34:05.449331   <   Accept-Ranges: bytes
10:34:05.449382   <
10:34:05.449440   {   [data not shown]
10:34:06.443613   *   Connection #0 to host bethesignal.org left intact
10:34:06.443714   *   Closing connection #0
webpagetest.org
            Sydney ADSL
webpagetest.org
            Los Angeles Fibre
webpagetest.org
            Los Angeles Fibre
The Network
Host DNS and web
services close to your
  primary audience.
(This is one reason why
 global web sites use CDNs,
particularly for static content.)
The Web Server
shovelling
               Apache
             mpm_prefork
                                                                                                  sho velling
              mod_php
shovelling
                *.php   ...
 and
 back
 again!
shovelling
               Apache
             mpm_prefork
                                                                                                  sho velling
              mod_php
shovelling
                *.png   ...
 and
 back
 again!
1 process per request

10-100MB per process
      (or more)
Right now, web
servers around the
planet are wasting
 gobs of memory
serving static files.
Try a different
process model.
You could use
mpm_worker…
MASSIVE
PHP FAIL
nginx
1 process per core

 request overhead
measured in kilobytes
shovelling
               nginx
             php-fastcgi
                                                                                                   sho velling
              [worker]
shovelling
               *.php     ...
 and
 back
 again!
nginx
shovelling

             *.png   ...
 and
 back
 again!
Apache and nginx




Netcraft Survey
 to May 2012
PHP
“There are only two hard things
  in Computing Science: cache
invalidation and naming things.”

         - Phil Karlton
It’s turtles all
the way down.
Opcode caching
Don’t let PHP do the same work twice.
APC
APC
  everywhere!
WordPress
Object caching
Don’t talk to the database if you don’t have to.
APC or memcache
wp-content/object-cache.php
Output or page caching
      Avoid PHP entirely…?
WP Super Cache
nginx
shovelling

             *.png   ...

More Related Content

Similar to TurboPress: The High Performance Guide to WordPress - Jeff Waugh - WordCamp Sydney 2012

Pushing the web — WebSockets
Pushing the web — WebSocketsPushing the web — WebSockets
Pushing the web — WebSockets
Roland M
 
Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?
timbc
 
05.m3 cms list-ofwebserver
05.m3 cms list-ofwebserver05.m3 cms list-ofwebserver
05.m3 cms list-ofwebserver
tarensi
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
Joseph Scott
 

Similar to TurboPress: The High Performance Guide to WordPress - Jeff Waugh - WordCamp Sydney 2012 (20)

如何使用 iframe 製作一個易於更新及更安全的前端套件
如何使用 iframe 製作一個易於更新及更安全的前端套件如何使用 iframe 製作一個易於更新及更安全的前端套件
如何使用 iframe 製作一個易於更新及更安全的前端套件
 
PAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonPAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark Tomlinson
 
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and WoeAltitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
Altitude San Francisco 2018: HTTP/2 Tales: Discovery and Woe
 
SPDY Talk
SPDY TalkSPDY Talk
SPDY Talk
 
Pushing the web — WebSockets
Pushing the web — WebSocketsPushing the web — WebSockets
Pushing the web — WebSockets
 
computer networking
computer networkingcomputer networking
computer networking
 
Building Lightning Fast Websites (for Twin Cities .NET User Group)
Building Lightning Fast Websites (for Twin Cities .NET User Group)Building Lightning Fast Websites (for Twin Cities .NET User Group)
Building Lightning Fast Websites (for Twin Cities .NET User Group)
 
Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?
 
05.m3 cms list-ofwebserver
05.m3 cms list-ofwebserver05.m3 cms list-ofwebserver
05.m3 cms list-ofwebserver
 
Surviving Slashdot
Surviving SlashdotSurviving Slashdot
Surviving Slashdot
 
Tuning the Kernel for Varnish Cache
Tuning the Kernel for Varnish CacheTuning the Kernel for Varnish Cache
Tuning the Kernel for Varnish Cache
 
Usenix LISA 2012 - Choosing a Proxy
Usenix LISA 2012 - Choosing a ProxyUsenix LISA 2012 - Choosing a Proxy
Usenix LISA 2012 - Choosing a Proxy
 
Restful web services with nodejs
Restful web services with nodejsRestful web services with nodejs
Restful web services with nodejs
 
tdc2012
tdc2012tdc2012
tdc2012
 
DNS for Developers - ConFoo Montreal
DNS for Developers - ConFoo MontrealDNS for Developers - ConFoo Montreal
DNS for Developers - ConFoo Montreal
 
5 things you didn't know nginx could do velocity
5 things you didn't know nginx could do   velocity5 things you didn't know nginx could do   velocity
5 things you didn't know nginx could do velocity
 
Reducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAGReducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAG
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
Website Analysis Report - Website Designing Proposal
Website Analysis Report - Website Designing ProposalWebsite Analysis Report - Website Designing Proposal
Website Analysis Report - Website Designing Proposal
 
Silverlight Wireshark Analysis
Silverlight Wireshark AnalysisSilverlight Wireshark Analysis
Silverlight Wireshark Analysis
 

More from WordCamp Sydney

Securing your WordPress Website - Vlad Lasky - WordCamp Sydney 2012
Securing your WordPress Website - Vlad Lasky - WordCamp Sydney 2012Securing your WordPress Website - Vlad Lasky - WordCamp Sydney 2012
Securing your WordPress Website - Vlad Lasky - WordCamp Sydney 2012
WordCamp Sydney
 

More from WordCamp Sydney (17)

How To Get Paid What You’re Worth - Troy Dean - WordCamp Sydney 2012
How To Get Paid What You’re Worth - Troy Dean - WordCamp Sydney 2012How To Get Paid What You’re Worth - Troy Dean - WordCamp Sydney 2012
How To Get Paid What You’re Worth - Troy Dean - WordCamp Sydney 2012
 
Not Just another WordPress Site Design - Phil Peet - WordCamp Sydney 2012
Not Just another WordPress Site Design - Phil Peet - WordCamp Sydney 2012Not Just another WordPress Site Design - Phil Peet - WordCamp Sydney 2012
Not Just another WordPress Site Design - Phil Peet - WordCamp Sydney 2012
 
What Multisite can do for You - Anthony Cole - WordCamp Sydney 2012
What Multisite can do for You - Anthony Cole - WordCamp Sydney 2012What Multisite can do for You - Anthony Cole - WordCamp Sydney 2012
What Multisite can do for You - Anthony Cole - WordCamp Sydney 2012
 
Demystifying Custom Post Types and Taxonomies - Tracey Kemp - WordCamp Sydney...
Demystifying Custom Post Types and Taxonomies - Tracey Kemp - WordCamp Sydney...Demystifying Custom Post Types and Taxonomies - Tracey Kemp - WordCamp Sydney...
Demystifying Custom Post Types and Taxonomies - Tracey Kemp - WordCamp Sydney...
 
Child Theming WordPress - Chris Aprea - WordCamp Sydney 2012
Child Theming WordPress - Chris Aprea - WordCamp Sydney 2012Child Theming WordPress - Chris Aprea - WordCamp Sydney 2012
Child Theming WordPress - Chris Aprea - WordCamp Sydney 2012
 
Responsive WordPress - Jordan Gillman - WordCamp Sydney 2012
Responsive WordPress - Jordan Gillman - WordCamp Sydney 2012Responsive WordPress - Jordan Gillman - WordCamp Sydney 2012
Responsive WordPress - Jordan Gillman - WordCamp Sydney 2012
 
The Power of Your Story Through WordPress and Social Media - Kimanzi Constabl...
The Power of Your Story Through WordPress and Social Media - Kimanzi Constabl...The Power of Your Story Through WordPress and Social Media - Kimanzi Constabl...
The Power of Your Story Through WordPress and Social Media - Kimanzi Constabl...
 
Siloing your Site for SEO Success - Stephen Cronin - WordCamp Sydney 2012
Siloing your Site for SEO Success - Stephen Cronin - WordCamp Sydney 2012Siloing your Site for SEO Success - Stephen Cronin - WordCamp Sydney 2012
Siloing your Site for SEO Success - Stephen Cronin - WordCamp Sydney 2012
 
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
Stop Hacking WordPress, Start Working with it - Charly Leetham - WordCamp Syd...
 
The Plugin Spectactular - Tony Cosentino - WordCamp Sydney 2012
The Plugin Spectactular - Tony Cosentino - WordCamp Sydney 2012The Plugin Spectactular - Tony Cosentino - WordCamp Sydney 2012
The Plugin Spectactular - Tony Cosentino - WordCamp Sydney 2012
 
Optimising SEO for WordPress - Lisa Davis - WordCamp Sydney 2012
Optimising SEO for WordPress - Lisa Davis - WordCamp Sydney 2012Optimising SEO for WordPress - Lisa Davis - WordCamp Sydney 2012
Optimising SEO for WordPress - Lisa Davis - WordCamp Sydney 2012
 
Word to the Future - Brent Shepherd - WordCamp Sydney 2012
Word to the Future - Brent Shepherd - WordCamp Sydney 2012Word to the Future - Brent Shepherd - WordCamp Sydney 2012
Word to the Future - Brent Shepherd - WordCamp Sydney 2012
 
Securing your WordPress Website - Vlad Lasky - WordCamp Sydney 2012
Securing your WordPress Website - Vlad Lasky - WordCamp Sydney 2012Securing your WordPress Website - Vlad Lasky - WordCamp Sydney 2012
Securing your WordPress Website - Vlad Lasky - WordCamp Sydney 2012
 
Inclusive Design Principles for WordPress - Joe Ortenzi - WordCamp Sydney
Inclusive Design Principles for WordPress - Joe Ortenzi - WordCamp SydneyInclusive Design Principles for WordPress - Joe Ortenzi - WordCamp Sydney
Inclusive Design Principles for WordPress - Joe Ortenzi - WordCamp Sydney
 
There's More than 1 Way to Skin a WordPress Theme - Lachlan MacPherson - Word...
There's More than 1 Way to Skin a WordPress Theme - Lachlan MacPherson - Word...There's More than 1 Way to Skin a WordPress Theme - Lachlan MacPherson - Word...
There's More than 1 Way to Skin a WordPress Theme - Lachlan MacPherson - Word...
 
WordPress for Noobs - Wil Brown - WordCamp Sydney 2012
WordPress for Noobs - Wil Brown - WordCamp Sydney 2012WordPress for Noobs - Wil Brown - WordCamp Sydney 2012
WordPress for Noobs - Wil Brown - WordCamp Sydney 2012
 
Getting to Grips with Firebug - Anthony Hortin - WordCamp Sydney
Getting to Grips with Firebug - Anthony Hortin - WordCamp SydneyGetting to Grips with Firebug - Anthony Hortin - WordCamp Sydney
Getting to Grips with Firebug - Anthony Hortin - WordCamp Sydney
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

TurboPress: The High Performance Guide to WordPress - Jeff Waugh - WordCamp Sydney 2012

  • 1. TurboPress The High Performance Guide to WordPress
  • 2. Let’s start with some theory.
  • 4. Browser sho velling shovelling Web Server PHP shovelling WordPress shovelling MySQL
  • 6. 1. DNS “ bethesignal.org ” Browser Router ISP DNS “ 70 . 85 . 31 . 216 “ DNS Host
  • 7. 1. DNS “ bethesignal.org ” Browser 10 ms Router 160 ms ISP DNS “ 70 . 85 . 31 . 216 “ 210 ms DNS Host
  • 8. 1. DNS “ bethesignal.org ” Browser 10 ms Router 160 ms ISP DNS “ 70 . 85 . 31 . 216 “ 210 ms DNS Host Google’s web performance team calculate the average DNS query takes 130ms!
  • 9. 2. HTTP “ bethesignal.org “ Browser 10 ms Router 160 ms ISP DNS “ 70 . 85 . 31 . 216 “ 210 ms DNS Host 70 . 85 . 31 . 216 : 80 Web Ser ver
  • 10. 2. HTTP “ bethesignal.org “ Browser 10 ms Router 160 ms ISP DNS “ 70 . 85 . 31 . 216 “ 210 ms 220 ms DNS Host 70 . 85 . 31 . 216 : 80 Web Ser ver
  • 11. 3. PHP “ bethesignal.org “ Browser 10 ms Router 160 ms ISP DNS “ 70 . 85 . 31 . 216 “ 210 ms 220 ms DNS Host 70 . 85 . 31 . 216 : 80 Web Ser ver PHP
  • 12. 3. PHP “ bethesignal.org “ Browser 10 ms Router 160 ms ISP DNS “ 70 . 85 . 31 . 216 “ 210 ms 220 ms DNS Host 70 . 85 . 31 . 216 : 80 650 ms Web Ser ver PHP
  • 13. 4. MySQL “ bethesignal.org “ Browser 10 ms Router 160 ms ISP DNS “ 70 . 85 . 31 . 216 “ 210 ms 220 ms DNS Host 70 . 85 . 31 . 216 : 80 Web Ser ver PHP MySQL
  • 14. 5. Back to the browser!
  • 15. Browser sho velling shovelling Web Server PHP shovelling WordPress shovelling MySQL
  • 17. GET / HTTP/1.1 Host: bethesignal.org Connection: keep-alive User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-AU,en;q=0.8,en-US;q=0.6 Accept-Charset: UTF-8,*;q=0.5 Cookie: wordpress_logged_in_...=jdub... If-Modified-Since: Thu, 12 Jul 2012 21:27:06 GMT HTTP/1.1 200 OK Server: nginx/1.2.1 Date: Fri, 20 Jul 2012 23:48:04 GMT Content-Type: text/html; charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive Vary: Accept-Encoding Vary: Cookie X-Pingback: http://bethesignal.org/xmlrpc.php Expires: Wed, 11 Jan 1984 05:00:00 GMT Last-Modified: Fri, 20 Jul 2012 23:48:03 GMT Cache-Control: no-cache, must-revalidate, max-age=0 Pragma: no-cache Content-Encoding: gzip
  • 18. 10:32:16.084565 * About to connect() to bethesignal.org port 80 (#0) 10:32:16.084768 * Trying 70.85.31.216... TCP_NODELAY set 10:32:16.283247 * connected 10:32:16.283376 * Connected to bethesignal.org (70.85.31.216) port 80 (#0) 10:32:16.283528 > GET / HTTP/1.1 10:32:16.283528 > User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/... 10:32:16.283528 > Host: bethesignal.org 10:32:16.283528 > Accept: */* 10:32:16.283528 > Accept-Encoding: deflate, gzip 10:32:16.283528 > Cookie: wordpress_logged_in_...=jdub... 10:32:16.283528 > 10:32:16.995103 < HTTP/1.1 200 OK 10:32:16.995216 < Server: nginx/1.2.1 10:32:16.995240 < Date: Sat, 21 Jul 2012 00:32:16 GMT 10:32:16.995295 < Content-Type: text/html; charset=UTF-8 10:32:16.995374 < Transfer-Encoding: chunked 10:32:16.995412 < Connection: keep-alive 10:32:16.995447 < Vary: Accept-Encoding 10:32:16.995482 < Vary: Cookie 10:32:16.995515 < X-Pingback: http://bethesignal.org/xmlrpc.php 10:32:16.995548 < Expires: Wed, 11 Jan 1984 05:00:00 GMT 10:32:16.995601 < Last-Modified: Sat, 21 Jul 2012 00:32:16 GMT 10:32:16.995642 < Cache-Control: no-cache, must-revalidate, max-age=0 10:32:16.995680 < Pragma: no-cache 10:32:16.995717 < Content-Encoding: gzip 10:32:16.995759 < 10:32:16.995794 { [data not shown] 10:32:17.393072 * Connection #0 to host bethesignal.org left intact 10:32:17.393170 * Closing connection #0
  • 19. Now you have some <html> …
  • 20. GET /wp-content/uploads/2011/04/strange-days.jpg HTTP/1.1 Host: bethesignal.org Connection: keep-alive Cache-Control: no-cache Pragma: no-cache User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Referer: http://bethesignal.org/ Accept-Encoding: gzip,deflate,sdch Accept-Language: en-AU,en;q=0.8,en-US;q=0.6 Accept-Charset: UTF-8,*;q=0.5 Cookie: wordpress_logged_in_...=jdub... HTTP/1.1 200 OK Server: nginx/1.2.1 Date: Fri, 20 Jul 2012 23:50:50 GMT Content-Type: image/jpeg Content-Length: 180112 Last-Modified: Fri, 08 Apr 2011 14:25:27 GMT Connection: keep-alive Expires: Wed, 19 Jul 2017 23:50:50 GMT Cache-Control: max-age=157680000 Accept-Ranges: bytes
  • 21. 10:34:05.051972 * About to connect() to bethesignal.org port 80 (#0) 10:34:05.052162 * Trying 70.85.31.216... TCP_NODELAY set 10:34:05.251898 * connected 10:34:05.251989 * Connected to bethesignal.org (70.85.31.216) port 80 (#0) 10:34:05.252123 > GET /wp-content/uploads/2011/04/strange-days.jpg HTTP/1.1 10:34:05.252123 > User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/... 10:34:05.252123 > Host: bethesignal.org 10:34:05.252123 > Accept: */* 10:34:05.252123 > Accept-Encoding: deflate, gzip 10:34:05.252123 > Cookie: wordpress_logged_in_...=jdub... 10:34:05.252123 > 10:34:05.448816 < HTTP/1.1 200 OK 10:34:05.448981 < Server: nginx/1.2.1 10:34:05.449045 < Date: Sat, 21 Jul 2012 00:34:05 GMT 10:34:05.449091 < Content-Type: image/jpeg 10:34:05.449131 < Content-Length: 180112 10:34:05.449170 < Last-Modified: Fri, 08 Apr 2011 14:25:27 GMT 10:34:05.449211 < Connection: keep-alive 10:34:05.449250 < Expires: Thu, 20 Jul 2017 00:34:05 GMT 10:34:05.449290 < Cache-Control: max-age=157680000 10:34:05.449331 < Accept-Ranges: bytes 10:34:05.449382 < 10:34:05.449440 { [data not shown] 10:34:06.443613 * Connection #0 to host bethesignal.org left intact 10:34:06.443714 * Closing connection #0
  • 22. webpagetest.org Sydney ADSL
  • 23. webpagetest.org Los Angeles Fibre
  • 24. webpagetest.org Los Angeles Fibre
  • 26. Host DNS and web services close to your primary audience.
  • 27. (This is one reason why global web sites use CDNs, particularly for static content.)
  • 29. shovelling Apache mpm_prefork sho velling mod_php shovelling *.php ...
  • 30.  and
  • 33. shovelling Apache mpm_prefork sho velling mod_php shovelling *.png ...
  • 34.  and
  • 37. 1 process per request 10-100MB per process (or more)
  • 38. Right now, web servers around the planet are wasting gobs of memory serving static files.
  • 42. nginx
  • 43. 1 process per core request overhead measured in kilobytes
  • 44. shovelling nginx php-fastcgi sho velling [worker] shovelling *.php ...
  • 45.  and
  • 48. nginx shovelling *.png ...
  • 49.  and
  • 52. Apache and nginx Netcraft Survey to May 2012
  • 53. PHP
  • 54. “There are only two hard things in Computing Science: cache invalidation and naming things.” - Phil Karlton
  • 56. Opcode caching Don’t let PHP do the same work twice.
  • 57. APC
  • 60. Object caching Don’t talk to the database if you don’t have to.
  • 62. Output or page caching Avoid PHP entirely…?
  • 64. nginx shovelling *.png ...
  • 65.  and
  • 69. Reverse proxy cache, such as nginx, Varnish
  • 70. MySQL
  • 71. Query (or results) cache Don’t let MySQL do the same work twice.
  • 72. Schema, index and behavioural optimisation Don’t tell MySQL do stupid work in the first place.
  • 74. Raw performance vs. Perception of performance
  • 76.
  • 77.
  • 78.