scaling wordpress
DESCRIPTION
TRANSCRIPT
![Page 1: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/1.jpg)
Making WordPressGo “Vroom”
Mark Jaquith“JAKE-with”
![Page 2: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/2.jpg)
Survey
![Page 3: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/3.jpg)
MATH TIME50k pages/day = 0.58 pages/second
Uh... that’s it?
![Page 4: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/4.jpg)
Traffic isn’t steady
![Page 5: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/5.jpg)
Speed Ma"ers
![Page 6: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/6.jpg)
Scaling a Single Server
![Page 7: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/7.jpg)
Apache
![Page 8: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/8.jpg)
nginx
![Page 9: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/9.jpg)
proxy to Apacheor
PHP-FPM
![Page 10: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/10.jpg)
PHPOpcode Cache
![Page 11: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/11.jpg)
WP Object Cache
![Page 12: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/12.jpg)
HTMLOutputCache
Batcache || W3 Total Cache || WP Super Cache
![Page 13: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/13.jpg)
Nginx Microcache
![Page 14: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/14.jpg)
Fragment Caching
if ( $html = get_transient( 'expensive-html-chunk' ) ) { echo $html;} else { $html = dynamically_generate_foo(); set_transient( 'expensive-html-chunk', $html, 3600 ); echo $html;}
![Page 15: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/15.jpg)
TLC Transients
echo tlc_transient( 'example-feed' ) ->updates_with( 'my_callback' ) ->expires_in( 300 ) ->background_only() ->get();
![Page 16: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/16.jpg)
MySQL Query Cache
![Page 17: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/17.jpg)
CDN— with —
Origin Pull
![Page 18: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/18.jpg)
Guideline:1000ms+ — Really slow
350–999ms — Slow250–349ms — Okay100–249ms — Fast
0–99ms — ZOMG FAST
![Page 19: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/19.jpg)
The Optimization
Cycle
![Page 20: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/20.jpg)
Dead-simple bo!leneck identification
<!--timer: <?php timer_stop(true) ?>-->
![Page 22: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/22.jpg)
Nginxcaching
![Page 23: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/23.jpg)
Proactivepurging
![Page 24: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/24.jpg)
Result?
![Page 25: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/25.jpg)
$ ab -c 350 -n 5000 http://havebabyneedstuff.com/
Result?Requests per second: 8114.53 [#/sec] (mean)
95% of requests served within 40ms99% of requests served within 82ms
![Page 26: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/26.jpg)
Multiple Servers
![Page 27: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/27.jpg)
Load Balancing
![Page 28: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/28.jpg)
Sharing Uploads
![Page 29: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/29.jpg)
Memcached
![Page 30: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/30.jpg)
Rinse & Repeat
![Page 31: Scaling WordPress](https://reader037.vdocuments.site/reader037/viewer/2022103014/54b3bdcd4a79599e528b4709/html5/thumbnails/31.jpg)
HyperDB