scaling wordpress

Post on 12-Jan-2015

696 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

Making WordPressGo “Vroom”

Mark Jaquith“JAKE-with”

@markjaquithmark@jaquith.memarkjaquith.com

Survey

MATH TIME50k pages/day = 0.58 pages/second

Uh... that’s it?

Traffic isn’t steady

Speed Ma"ers

Scaling a Single Server

Apache

nginx

proxy to Apacheor

PHP-FPM

PHPOpcode Cache

WP Object Cache

HTMLOutputCache

Batcache || W3 Total Cache || WP Super Cache

Nginx Microcache

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;}

TLC Transients

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

MySQL Query Cache

CDN— with —

Origin Pull

Guideline:1000ms+ — Really slow

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

0–99ms — ZOMG FAST

The Optimization

Cycle

Dead-simple bo!leneck identification

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

Case Studyhavebabyneedstuff.com

Nginxcaching

Proactivepurging

Result?

$ 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

Multiple Servers

Load Balancing

Sharing Uploads

Memcached

Rinse & Repeat

HyperDB

Thanks!Mark Jaquith“JAKE-with”

@markjaquithmark@jaquith.memarkjaquith.com

top related