SlideShare a Scribd company logo
Coding
       Mark Jaquith
                        “JAKE-with”
                                      Scaling
                                        and
        @markjaquith
                                      Deploys
       mark@jaquith.me
       markjaquith.com                 O hM y!
Friday, August 12, 11
Meanwhile, in 2006...




                                    Photo by Sco Beale (Laughing Squid)



Friday, August 12, 11
Cowboy
                        Coding
Friday, August 12, 11
PE R! BA D!
                     AD DE VELO
                   B
                        Cowboy
                        Coding
Friday, August 12, 11
bnj.com/cowboy-coding-pink-sombrero


Friday, August 12, 11
VCS    • or •   GTFO

Friday, August 12, 11
WordPress
                        in your repo

Friday, August 12, 11
My Ideal
                        index.php
                        wp-config.php
                        content/themes/
                        content/plugins/
                        content/uploads/ (ignored)
                        wp ➠ EXTERNAL

Friday, August 12, 11
Local
                   Development
Friday, August 12, 11
1. MAMP, XAMPP, other
                        2. /etc/hosts
                        3. local-config.php

Friday, August 12, 11
if ( file_exists( dirname( __FILE__ ) . '/local-config.php' ) ) {
                   include( dirname( __FILE__ ) . '/local-config.php' );
                   define( 'WP_LOCAL_DEV', true );
                 } else {
                   define( 'WP_LOCAL_DEV', false );
                   define( 'DB_NAME',     'production_db'       );
                   define( 'DB_USER',     'production_user'     );
                   define( 'DB_PASSWORD', 'production_password' );
                   define( 'DB_HOST',     'production_db_host' );
                 }




                        Ignore local-config.php so
                         it doesn’t get checked in.

Friday, August 12, 11
Deploying
                         — with —




Friday, August 12, 11
1. gem install capistrano
                        2. gem install railsless-deploy
                        3. gem install capistrano-ext

Friday, August 12, 11
releases/
          current => {current-release}
          shared/cached-copy
          shared/files/


Friday, August 12, 11
checked in:
           content/uploads => ../../files/uploads/



           done on deploy:
           files => /srv/www/example.org/shared/files/



Friday, August 12, 11
Scaling
             a Single Server

Friday, August 12, 11
nginx
Friday, August 12, 11
proxy to Apache
                              or
                        PHP-FPM
Friday, August 12, 11
PHP
                        Opcode
                        Cache
Friday, August 12, 11
WP
                        Object
                        Cache
Friday, August 12, 11
HTML
                             Output
                             Cache
                        Batcache || W3 Total Cache

Friday, August 12, 11
Fragment
                                  Caching
                   if ( $html = wp_cache_get( 'expensive-html-chunk', 'my-theme' ) ) {
                     echo $html;
                   } else {
                     $html = dynamically_generate_foo();
                     wp_cache_set( 'expensive-html-chunk', $html, 'my-theme', 3600 );
                     echo $html;
                   }




Friday, August 12, 11
MySQL
           Query Cache
Friday, August 12, 11
CDN
                           — with —
                        Origin Pull
Friday, August 12, 11
The Plan



Friday, August 12, 11
The Plan
                        What happens if we
                        outgrow our server?



        Boss
                                              Tech

Friday, August 12, 11
The Plan
                        What happens if we
                        outgrow our server?

                                              We’ll just add new
        Boss                                       servers!




                                                          Tech

Friday, August 12, 11
The Plan
                        What happens if we
                        outgrow our server?

                                              We’ll just add new
        Boss                                       servers!


                              Brilliant!
                                                          Tech

Friday, August 12, 11
The Plan



Friday, August 12, 11
The Reality



Friday, August 12, 11
The Reality
                         Our site is slow. Let’s
                         add another server.



        Boss
                                                   Tech

Friday, August 12, 11
The Reality
                         Our site is slow. Let’s
                         add another server.


                                                   Uh...
        Boss
                                                       Tech

Friday, August 12, 11
The Reality
                         Our site is slow. Let’s
                         add another server.


                                                    Uh...
        Boss
                         So this will take like 5
                             minutes, right?
                                                        Tech

Friday, August 12, 11
Have a plan

                   Not an idea
Friday, August 12, 11
Multiple
                        Servers
Friday, August 12, 11
Load
                        Balancing
Friday, August 12, 11
Sharing
                        Uploads
Friday, August 12, 11
Memcached

Friday, August 12, 11
Rinse &
                        Repeat
Friday, August 12, 11
HyperDB

Friday, August 12, 11
Maintaining
                        Servers with
                        Puppet
Friday, August 12, 11
This is the start of a
             larger conversation


Friday, August 12, 11
Mark Jaquith
                        “JAKE-with”   Thanks!
        @markjaquith
       mark@jaquith.me
       markjaquith.com

Friday, August 12, 11

More Related Content

PDF
eZ Publish Caching Mechanisms
PDF
Going crazy with Varnish and Symfony
PDF
Improving Your Heroku App Performance with Asset CDN and Unicorn
KEY
Puppet for dummies - ZendCon 2011 Edition
PDF
Puppet fundamentals
PDF
eZ UnConference - Z Publish top-performance through mastery (and extension) o...
PDF
VUG5: Varnish at Opera Software
PDF
CakePHPのWebTestCaseでfixtureを使う
eZ Publish Caching Mechanisms
Going crazy with Varnish and Symfony
Improving Your Heroku App Performance with Asset CDN and Unicorn
Puppet for dummies - ZendCon 2011 Edition
Puppet fundamentals
eZ UnConference - Z Publish top-performance through mastery (and extension) o...
VUG5: Varnish at Opera Software
CakePHPのWebTestCaseでfixtureを使う

What's hot (20)

KEY
Riak with Rails
PDF
Dutch php conference_apc_mem2010
ODP
Caching and tuning fun for high scalability @ FOSDEM 2012
PDF
Challenges when building high profile editorial sites
PDF
Scaling to-5000-nodes
PDF
How to deploy & optimize eZ Publish (2014)
PPTX
Making Symofny shine with Varnish - SymfonyCon Madrid 2014
PDF
My Opera meets Varnish, Dec 2009
PPTX
Deployment with Fabric
PDF
Demystifying eZ Publish 5.x for eZ Publish 4.0 developers
PPTX
Northeast PHP - High Performance PHP
PDF
Nginx Workshop Aftermath
PPTX
PyCon Russia 2014 - Auto Scale in the Cloud
PPT
Hackingtomcat
PPTX
Tuning the Performance of Your ColdFusion Environment to Racecar Specs!
PDF
How to deploy & optimize eZ Publish
ZIP
All The Little Pieces
PDF
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
PDF
Learning Puppet Chapter 1
PDF
Writing your own augeasproviders
Riak with Rails
Dutch php conference_apc_mem2010
Caching and tuning fun for high scalability @ FOSDEM 2012
Challenges when building high profile editorial sites
Scaling to-5000-nodes
How to deploy & optimize eZ Publish (2014)
Making Symofny shine with Varnish - SymfonyCon Madrid 2014
My Opera meets Varnish, Dec 2009
Deployment with Fabric
Demystifying eZ Publish 5.x for eZ Publish 4.0 developers
Northeast PHP - High Performance PHP
Nginx Workshop Aftermath
PyCon Russia 2014 - Auto Scale in the Cloud
Hackingtomcat
Tuning the Performance of Your ColdFusion Environment to Racecar Specs!
How to deploy & optimize eZ Publish
All The Little Pieces
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Learning Puppet Chapter 1
Writing your own augeasproviders
Ad

Viewers also liked (20)

PDF
eMusic: WordPress in the Enterprise
PDF
WordCamp SF 2011: Debugging in WordPress
PDF
WordCamp San Francisco 2011: Transients, Caching, and the Complexities of Mul...
PDF
How Testing Changed My Life
PDF
E-commerce & WordPress: Navigating the Minefield
PDF
State of the Word 2016
PDF
State of the Word 2015, WordCamp US
PDF
Taking WordPress to the World : Options for a Multilingual Site | WordCamp Sa...
PDF
Don't Repeat Your Mistakes: JavaScript Unit Testing
PDF
DNS exfiltration using sqlmap
PDF
How WordPress Changed My Life! - Ricky Blacker
PDF
The Child Theme Dilemma (EN) - Milano Edition
PPT
Architecture Behind WordPress.com
PPTX
WordPress Development with VVV, VV, and Vagrant
PDF
WordPress 4.4 and Beyond
PDF
What is the Responsibility of Plugin Developers?
PDF
WordPress: Getting Under the Hood
PDF
Architecting an Highly Available and Scalable WordPress Site in AWS
PDF
Pushing Python: Building a High Throughput, Low Latency System
PDF
Twitter Presentation: #APIConSF
eMusic: WordPress in the Enterprise
WordCamp SF 2011: Debugging in WordPress
WordCamp San Francisco 2011: Transients, Caching, and the Complexities of Mul...
How Testing Changed My Life
E-commerce & WordPress: Navigating the Minefield
State of the Word 2016
State of the Word 2015, WordCamp US
Taking WordPress to the World : Options for a Multilingual Site | WordCamp Sa...
Don't Repeat Your Mistakes: JavaScript Unit Testing
DNS exfiltration using sqlmap
How WordPress Changed My Life! - Ricky Blacker
The Child Theme Dilemma (EN) - Milano Edition
Architecture Behind WordPress.com
WordPress Development with VVV, VV, and Vagrant
WordPress 4.4 and Beyond
What is the Responsibility of Plugin Developers?
WordPress: Getting Under the Hood
Architecting an Highly Available and Scalable WordPress Site in AWS
Pushing Python: Building a High Throughput, Low Latency System
Twitter Presentation: #APIConSF
Ad

Similar to Coding, Scaling, and Deploys... Oh My! (20)

PDF
Rcos presentation
PDF
Modern HTML & CSS Coding: Speed, Semantics & Structure
PDF
TorqueBox - When Java meets Ruby
PDF
ZFS and FreeBSD Jails
PDF
Big app design for Node.js
PDF
Optimizing your site for contextual ads: SEO, Design and Content
PDF
Optimizing WordPress Performance on Shared Web Hosting
PDF
Lightning talks percona live mysql_2012
PDF
StORM preview
PDF
Tackling Big Data with Hadoop
PDF
Practicing Continuous Deployment
PDF
Cloudstack talk
PDF
It's code but not as we know: Infrastructure as Code - Patrick Debois
PDF
Localizing iOS Apps
PDF
Inside the Atlassian OnDemand Private Cloud
PDF
Fluentd and WebHDFS
PDF
Html5 Audio & video
PDF
Fast & Furious: Speed in the Opera browser
PDF
Multiplatform, Promises and HTML5
PDF
Apache Flume NG
Rcos presentation
Modern HTML & CSS Coding: Speed, Semantics & Structure
TorqueBox - When Java meets Ruby
ZFS and FreeBSD Jails
Big app design for Node.js
Optimizing your site for contextual ads: SEO, Design and Content
Optimizing WordPress Performance on Shared Web Hosting
Lightning talks percona live mysql_2012
StORM preview
Tackling Big Data with Hadoop
Practicing Continuous Deployment
Cloudstack talk
It's code but not as we know: Infrastructure as Code - Patrick Debois
Localizing iOS Apps
Inside the Atlassian OnDemand Private Cloud
Fluentd and WebHDFS
Html5 Audio & video
Fast & Furious: Speed in the Opera browser
Multiplatform, Promises and HTML5
Apache Flume NG

More from Mark Jaquith (15)

PDF
Cache Money Business
PDF
Scaling WordPress
PDF
Creating and Maintaining WordPress Plugins
PDF
WordPress Security - WordCamp Phoenix
PDF
WordPress Custom Post Types
PDF
Writing Your First WordPress Plugin
PDF
What I Hate About Wordpress
PDF
Writing Secure Plugins — WordCamp New York 2009
PDF
BuddyPress and the Future of WordPress Plugins
PDF
"State of the Word" at WordCamp Mid-Atlantic, by Mark Jaquith
PDF
Secure Coding With Wordpress (BarCamp Orlando 2009)
PDF
Wordcamp Charlotte: WordPress Today and Tomorrow
PDF
Secure Coding with WordPress - WordCamp SF 2008
PPT
Amping up your WordPress Blog
PDF
Contributing To WordPress
Cache Money Business
Scaling WordPress
Creating and Maintaining WordPress Plugins
WordPress Security - WordCamp Phoenix
WordPress Custom Post Types
Writing Your First WordPress Plugin
What I Hate About Wordpress
Writing Secure Plugins — WordCamp New York 2009
BuddyPress and the Future of WordPress Plugins
"State of the Word" at WordCamp Mid-Atlantic, by Mark Jaquith
Secure Coding With Wordpress (BarCamp Orlando 2009)
Wordcamp Charlotte: WordPress Today and Tomorrow
Secure Coding with WordPress - WordCamp SF 2008
Amping up your WordPress Blog
Contributing To WordPress

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Approach and Philosophy of On baking technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Cloud computing and distributed systems.
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
KodekX | Application Modernization Development
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Spectral efficient network and resource selection model in 5G networks
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Approach and Philosophy of On baking technology
Understanding_Digital_Forensics_Presentation.pptx
Cloud computing and distributed systems.
NewMind AI Monthly Chronicles - July 2025
Mobile App Security Testing_ A Comprehensive Guide.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KodekX | Application Modernization Development
The Rise and Fall of 3GPP – Time for a Sabbatical?
Dropbox Q2 2025 Financial Results & Investor Presentation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Review of recent advances in non-invasive hemoglobin estimation
Per capita expenditure prediction using model stacking based on satellite ima...
Unlocking AI with Model Context Protocol (MCP)
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Coding, Scaling, and Deploys... Oh My!

  • 1. Coding Mark Jaquith “JAKE-with” Scaling and @markjaquith Deploys mark@jaquith.me markjaquith.com O hM y! Friday, August 12, 11
  • 2. Meanwhile, in 2006... Photo by Sco Beale (Laughing Squid) Friday, August 12, 11
  • 3. Cowboy Coding Friday, August 12, 11
  • 4. PE R! BA D! AD DE VELO B Cowboy Coding Friday, August 12, 11
  • 6. VCS • or • GTFO Friday, August 12, 11
  • 7. WordPress in your repo Friday, August 12, 11
  • 8. My Ideal index.php wp-config.php content/themes/ content/plugins/ content/uploads/ (ignored) wp ➠ EXTERNAL Friday, August 12, 11
  • 9. Local Development Friday, August 12, 11
  • 10. 1. MAMP, XAMPP, other 2. /etc/hosts 3. local-config.php Friday, August 12, 11
  • 11. if ( file_exists( dirname( __FILE__ ) . '/local-config.php' ) ) { include( dirname( __FILE__ ) . '/local-config.php' ); define( 'WP_LOCAL_DEV', true ); } else { define( 'WP_LOCAL_DEV', false ); define( 'DB_NAME', 'production_db' ); define( 'DB_USER', 'production_user' ); define( 'DB_PASSWORD', 'production_password' ); define( 'DB_HOST', 'production_db_host' ); } Ignore local-config.php so it doesn’t get checked in. Friday, August 12, 11
  • 12. Deploying — with — Friday, August 12, 11
  • 13. 1. gem install capistrano 2. gem install railsless-deploy 3. gem install capistrano-ext Friday, August 12, 11
  • 14. releases/ current => {current-release} shared/cached-copy shared/files/ Friday, August 12, 11
  • 15. checked in: content/uploads => ../../files/uploads/ done on deploy: files => /srv/www/example.org/shared/files/ Friday, August 12, 11
  • 16. Scaling a Single Server Friday, August 12, 11
  • 18. proxy to Apache or PHP-FPM Friday, August 12, 11
  • 19. PHP Opcode Cache Friday, August 12, 11
  • 20. WP Object Cache Friday, August 12, 11
  • 21. HTML Output Cache Batcache || W3 Total Cache Friday, August 12, 11
  • 22. Fragment Caching if ( $html = wp_cache_get( 'expensive-html-chunk', 'my-theme' ) ) { echo $html; } else { $html = dynamically_generate_foo(); wp_cache_set( 'expensive-html-chunk', $html, 'my-theme', 3600 ); echo $html; } Friday, August 12, 11
  • 23. MySQL Query Cache Friday, August 12, 11
  • 24. CDN — with — Origin Pull Friday, August 12, 11
  • 26. The Plan What happens if we outgrow our server? Boss Tech Friday, August 12, 11
  • 27. The Plan What happens if we outgrow our server? We’ll just add new Boss servers! Tech Friday, August 12, 11
  • 28. The Plan What happens if we outgrow our server? We’ll just add new Boss servers! Brilliant! Tech Friday, August 12, 11
  • 31. The Reality Our site is slow. Let’s add another server. Boss Tech Friday, August 12, 11
  • 32. The Reality Our site is slow. Let’s add another server. Uh... Boss Tech Friday, August 12, 11
  • 33. The Reality Our site is slow. Let’s add another server. Uh... Boss So this will take like 5 minutes, right? Tech Friday, August 12, 11
  • 34. Have a plan Not an idea Friday, August 12, 11
  • 35. Multiple Servers Friday, August 12, 11
  • 36. Load Balancing Friday, August 12, 11
  • 37. Sharing Uploads Friday, August 12, 11
  • 39. Rinse & Repeat Friday, August 12, 11
  • 41. Maintaining Servers with Puppet Friday, August 12, 11
  • 42. This is the start of a larger conversation Friday, August 12, 11
  • 43. Mark Jaquith “JAKE-with” Thanks! @markjaquith mark@jaquith.me markjaquith.com Friday, August 12, 11