Weitere ähnliche Inhalte Ähnlich wie Coding, Scaling, and Deploys... Oh My! (20) Mehr von Mark Jaquith (15) Kürzlich hochgeladen (20) 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
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
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
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
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