Your SlideShare is downloading. ×
TurboPress: The High Performance Guide to WordPress - Jeff Waugh - WordCamp Sydney 2012
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

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

893

Published on

Jeff Waugh coaches WordCamp Sydney 2012 on turboboosting your WordPress site, and setting it up for Higher Performance #wcsyd

Jeff Waugh coaches WordCamp Sydney 2012 on turboboosting your WordPress site, and setting it up for Higher Performance #wcsyd

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
893
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. TurboPressThe High Performance Guide to WordPress
  • 2. Let’s start with some theory.
  • 3. INTERWEBS AMIRITE?
  • 4. Browser sho vellingshovelling Web Server PHP shovelling WordPressshovelling MySQL
  • 5. 0. The Browser
  • 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 vellingshovelling Web Server PHP shovelling WordPressshovelling MySQL
  • 16. Some gory detail…
  • 17. GET / HTTP/1.1Host: bethesignal.orgConnection: keep-aliveUser-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.11Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Encoding: gzip,deflate,sdchAccept-Language: en-AU,en;q=0.8,en-US;q=0.6Accept-Charset: UTF-8,*;q=0.5Cookie: wordpress_logged_in_...=jdub...If-Modified-Since: Thu, 12 Jul 2012 21:27:06 GMTHTTP/1.1 200 OKServer: nginx/1.2.1Date: Fri, 20 Jul 2012 23:48:04 GMTContent-Type: text/html; charset=UTF-8Transfer-Encoding: chunkedConnection: keep-aliveVary: Accept-EncodingVary: CookieX-Pingback: http://bethesignal.org/xmlrpc.phpExpires: Wed, 11 Jan 1984 05:00:00 GMTLast-Modified: Fri, 20 Jul 2012 23:48:03 GMTCache-Control: no-cache, must-revalidate, max-age=0Pragma: no-cacheContent-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 set10:32:16.283247 * connected10:32:16.283376 * Connected to bethesignal.org (70.85.31.216) port 80 (#0)10:32:16.283528 > GET / HTTP/1.110:32:16.283528 > User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/...10:32:16.283528 > Host: bethesignal.org10:32:16.283528 > Accept: */*10:32:16.283528 > Accept-Encoding: deflate, gzip10:32:16.283528 > Cookie: wordpress_logged_in_...=jdub...10:32:16.283528 >10:32:16.995103 < HTTP/1.1 200 OK10:32:16.995216 < Server: nginx/1.2.110:32:16.995240 < Date: Sat, 21 Jul 2012 00:32:16 GMT10:32:16.995295 < Content-Type: text/html; charset=UTF-810:32:16.995374 < Transfer-Encoding: chunked10:32:16.995412 < Connection: keep-alive10:32:16.995447 < Vary: Accept-Encoding10:32:16.995482 < Vary: Cookie10:32:16.995515 < X-Pingback: http://bethesignal.org/xmlrpc.php10:32:16.995548 < Expires: Wed, 11 Jan 1984 05:00:00 GMT10:32:16.995601 < Last-Modified: Sat, 21 Jul 2012 00:32:16 GMT10:32:16.995642 < Cache-Control: no-cache, must-revalidate, max-age=010:32:16.995680 < Pragma: no-cache10:32:16.995717 < Content-Encoding: gzip10:32:16.995759 <10:32:16.995794 { [data not shown]10:32:17.393072 * Connection #0 to host bethesignal.org left intact10:32:17.393170 * Closing connection #0
  • 19. Now you havesome <html> …
  • 20. GET /wp-content/uploads/2011/04/strange-days.jpg HTTP/1.1Host: bethesignal.orgConnection: keep-aliveCache-Control: no-cachePragma: no-cacheUser-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.11Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Referer: http://bethesignal.org/Accept-Encoding: gzip,deflate,sdchAccept-Language: en-AU,en;q=0.8,en-US;q=0.6Accept-Charset: UTF-8,*;q=0.5Cookie: wordpress_logged_in_...=jdub...HTTP/1.1 200 OKServer: nginx/1.2.1Date: Fri, 20 Jul 2012 23:50:50 GMTContent-Type: image/jpegContent-Length: 180112Last-Modified: Fri, 08 Apr 2011 14:25:27 GMTConnection: keep-aliveExpires: Wed, 19 Jul 2017 23:50:50 GMTCache-Control: max-age=157680000Accept-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 set10:34:05.251898 * connected10: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.110:34:05.252123 > User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/...10:34:05.252123 > Host: bethesignal.org10:34:05.252123 > Accept: */*10:34:05.252123 > Accept-Encoding: deflate, gzip10:34:05.252123 > Cookie: wordpress_logged_in_...=jdub...10:34:05.252123 >10:34:05.448816 < HTTP/1.1 200 OK10:34:05.448981 < Server: nginx/1.2.110:34:05.449045 < Date: Sat, 21 Jul 2012 00:34:05 GMT10:34:05.449091 < Content-Type: image/jpeg10:34:05.449131 < Content-Length: 18011210:34:05.449170 < Last-Modified: Fri, 08 Apr 2011 14:25:27 GMT10:34:05.449211 < Connection: keep-alive10:34:05.449250 < Expires: Thu, 20 Jul 2017 00:34:05 GMT10:34:05.449290 < Cache-Control: max-age=15768000010:34:05.449331 < Accept-Ranges: bytes10:34:05.449382 <10:34:05.449440 { [data not shown]10:34:06.443613 * Connection #0 to host bethesignal.org left intact10:34:06.443714 * Closing connection #0
  • 22. webpagetest.org Sydney ADSL
  • 23. webpagetest.org Los Angeles Fibre
  • 24. webpagetest.org Los Angeles Fibre
  • 25. The Network
  • 26. Host DNS and webservices close to your primary audience.
  • 27. (This is one reason why global web sites use CDNs,particularly for static content.)
  • 28. The Web Server
  • 29. shovelling Apache mpm_prefork sho velling mod_phpshovelling *.php ...
  • 30.  and
  • 31.  back
  • 32.  again!
  • 33. shovelling Apache mpm_prefork sho velling mod_phpshovelling *.png ...
  • 34.  and
  • 35.  back
  • 36.  again!
  • 37. 1 process per request10-100MB per process (or more)
  • 38. Right now, webservers around theplanet are wasting gobs of memoryserving static files.
  • 39. Try a differentprocess model.
  • 40. You could usempm_worker…
  • 41. MASSIVEPHP FAIL
  • 42. nginx
  • 43. 1 process per core request overheadmeasured in kilobytes
  • 44. shovelling nginx php-fastcgi sho velling [worker]shovelling *.php ...
  • 45.  and
  • 46.  back
  • 47.  again!
  • 48. nginxshovelling *.png ...
  • 49.  and
  • 50.  back
  • 51.  again!
  • 52. Apache and nginxNetcraft Survey to May 2012
  • 53. PHP
  • 54. “There are only two hard things in Computing Science: cacheinvalidation and naming things.” - Phil Karlton
  • 55. It’s turtles allthe way down.
  • 56. Opcode cachingDon’t let PHP do the same work twice.
  • 57. APC
  • 58. APC everywhere!
  • 59. WordPress
  • 60. Object cachingDon’t talk to the database if you don’t have to.
  • 61. APC or memcachewp-content/object-cache.php
  • 62. Output or page caching Avoid PHP entirely…?
  • 63. WP Super Cache
  • 64. nginxshovelling *.png ...
  • 65.  and
  • 66.  back
  • 67.  again!
  • 68. Batcache
  • 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 andbehavioural optimisation Don’t tell MySQL do stupid work in the first place.
  • 73. Browser
  • 74. Raw performance vs. Perception of performance
  • 75. Measure twice, cut once.
  • 76. “totes
  • 77.  insan
  • 78.  hosting
  • 79.  guys!” -
  • 80.  Peter

×