Coding, Scaling, and Deploys... Oh My!
-
Upload
mark-jaquith -
Category
Technology
-
view
8.989 -
download
0
description
Transcript of Coding, Scaling, and Deploys... Oh My!
Photo by Sco! Beale (Laughing Squid)
Meanwhile, in 2006...
Friday, August 12, 11
CowboyCoding
Friday, August 12, 11
CowboyCoding
BAD DEVELOPER! BAD!
Friday, August 12, 11
bnj.com/cowboy-coding-pink-sombrero
Friday, August 12, 11
VCS GTFO• or •
Friday, August 12, 11
WordPressin your repo
Friday, August 12, 11
My Ideal index.phpwp-config.phpcontent/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
nginxFriday, August 12, 11
proxy to Apacheor
PHP-FPMFriday, August 12, 11
PHPOpcode Cache
Friday, August 12, 11
WP Object Cache
Friday, August 12, 11
HTMLOutputCache
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 PullFriday, August 12, 11
The Plan
Friday, August 12, 11
What happens if we outgrow our server?
Boss
Tech
The Plan
Friday, August 12, 11
What happens if we outgrow our server?
Boss
Tech
We’ll just add new servers!
The Plan
Friday, August 12, 11
What happens if we outgrow our server?
Brilliant!
Boss
Tech
We’ll just add new servers!
The Plan
Friday, August 12, 11
The Plan
Friday, August 12, 11
The Reality
Friday, August 12, 11
Our site is slow. Let’s add another server.
Boss
Tech
The Reality
Friday, August 12, 11
Our site is slow. Let’s add another server.
Boss
Tech
Uh...
The Reality
Friday, August 12, 11
Our site is slow. Let’s add another server.
So this will take like 5 minutes, right?
Boss
Tech
Uh...
The Reality
Friday, August 12, 11
Have a plan
Not an ideaFriday, 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
MaintainingServers with
PuppetFriday, August 12, 11
This is the start of a larger conversation
Friday, August 12, 11
Thanks!Mark Jaquith“JAKE-with”
Friday, August 12, 11