Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Scale Out Don't Scale Up

xyu
May 16, 2015

Scale Out Don't Scale Up

Installing WordPress and getting it to serve up a site is easy. Getting that same site to stay up when millions are hitting it is not so much. In this talk We’ll go over both the tools and techniques to keep your site up as well as the theory behind operating at scale.

xyu

May 16, 2015
Tweet

More Decks by xyu

Other Decks in Technology

Transcript

  1.  18,600,000,000
 409,000,000 56,000,000
 68,000,000 5,000
 1 Page Views
 Unique

    Visitors
 New Posts
 New Comments
 Deploys
 WordPress Multisite
  2. Ways to Scale Software Hardware Be Faster Optimize Bigger Server

    Do More Async / Multithread More Servers
  3. Ways to Scale Software Hardware Be Faster Optimize Bigger Server

    Do More Async / Multithread More Servers
  4. Ways to Scale Software Hardware Be Faster Optimize Scaling Up

    Do More Async / Multithread More Servers
  5. Ways to Scale Software Hardware Be Faster Optimize Scaling Up

    Do More Async / Multithread Scaling Out
  6. Ways to Scale Software Hardware Be Faster Optimize Scaling Up

    Do More Async / Multithread Scaling Out
  7. Out Not Up - Amazon vCPU Memory (GB) Cost /

    HR t2.micro 1 1 $0.013 c4.8xlarge 36 60 $1.856
  8. Out Not Up - Amazon vCPU Memory (GB) Cost /

    HR t2.micro 1 1 $0.013 c4.8xlarge 36 60 $1.856 Δ 36x 60x 142x
  9. Out Not Up - Digital Ocean Smallest Largest Δ CPU

    Cores 1 20 20x Memory (GB) 0.5 64 128x Cost / Month $5 $640 128x
  10. Out Not Up - Amazon t2.micro c4.8xlarge Δ vCPU 1

    36 36x Memory (GB) 1 60 60x Cost / HR $0.013 $1.856 142x
  11. HTTP Request Headers GET /2015/ HTTP/1.1
 
 Host: maine.wordcamp.org
 Accept:

    text/html,…,image/webp,*/*;q=0.8
 Accept-Language: en-US,en;q=0.8
 Accept-Encoding: gzip, deflate, sdch
 Cache-Control: max-age=0
 Connection: keep-alive
 User-Agent: Mozilla/5.0…
 Cookie: WordPress_test_cookie=…
  12. function initSession() {
 if ( !session_id() ) {
 session_start();
 }


    $_SESSION[ 'my_key' ] = 'value';
 }
 
 add_action( 'init', 'initSession', 1 );
  13. function initSession() {
 if ( !session_id() ) {
 session_start();
 }


    $_SESSION[ 'my_key' ] = 'value';
 }
 
 add_action( 'init', 'initSession', 1 );
  14. Use WordPress CRUD APIs Site Data Post Data User Data

    Short Term Data APIs *_option() *_post_meta() *_user_option()
 *_user_meta() *_transient()
  15. Use WordPress CRUD APIs Site Data Post Data User Data

    Short Term Data APIs *_option() *_post_meta() *_user_option()
 *_user_meta() *_transient() Multisite *_site_option() *_site_transient()