scaling wordpress

32
Making WordPress Go “Vroom” Mark Jaquith “JAKE-with” @markjaquith [email protected] markjaquith.com

Upload: mark-jaquith

Post on 12-Jan-2015

696 views

Category:

Documents


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Scaling WordPress

Making WordPressGo “Vroom”

Mark Jaquith“JAKE-with”

@[email protected]

Page 2: Scaling WordPress

Survey

Page 3: Scaling WordPress

MATH TIME50k pages/day = 0.58 pages/second

Uh... that’s it?

Page 4: Scaling WordPress

Traffic isn’t steady

Page 5: Scaling WordPress

Speed Ma"ers

Page 6: Scaling WordPress

Scaling a Single Server

Page 7: Scaling WordPress

Apache

Page 8: Scaling WordPress

nginx

Page 9: Scaling WordPress

proxy to Apacheor

PHP-FPM

Page 10: Scaling WordPress

PHPOpcode Cache

Page 11: Scaling WordPress

WP Object Cache

Page 12: Scaling WordPress

HTMLOutputCache

Batcache || W3 Total Cache || WP Super Cache

Page 13: Scaling WordPress

Nginx Microcache

Page 14: Scaling WordPress

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

TLC Transients

echo tlc_transient( 'example-feed' ) ->updates_with( 'my_callback' ) ->expires_in( 300 ) ->background_only() ->get();

Page 16: Scaling WordPress

MySQL Query Cache

Page 17: Scaling WordPress

CDN— with —

Origin Pull

Page 18: Scaling WordPress

Guideline:1000ms+ — Really slow

350–999ms — Slow250–349ms — Okay100–249ms — Fast

0–99ms — ZOMG FAST

Page 19: Scaling WordPress

The Optimization

Cycle

Page 20: Scaling WordPress

Dead-simple bo!leneck identification

<!--timer: <?php timer_stop(true) ?>-->

Page 21: Scaling WordPress

Case Studyhavebabyneedstuff.com

Page 22: Scaling WordPress

Nginxcaching

Page 23: Scaling WordPress

Proactivepurging

Page 24: Scaling WordPress

Result?

Page 25: Scaling WordPress

$ 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

Multiple Servers

Page 27: Scaling WordPress

Load Balancing

Page 28: Scaling WordPress

Sharing Uploads

Page 29: Scaling WordPress

Memcached

Page 30: Scaling WordPress

Rinse & Repeat

Page 31: Scaling WordPress

HyperDB

Page 32: Scaling WordPress

Thanks!Mark Jaquith“JAKE-with”

@[email protected]