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

10,066 views

Published on

You're a professional WordPress developer in charge of a professional WordPress site. It's time to have professional development and deployment practices.

Published in: Technology
0 Comments
20 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
10,066
On SlideShare
0
From Embeds
0
Number of Embeds
1,210
Actions
Shares
0
Downloads
67
Comments
0
Likes
20
Embeds 0
No embeds

No notes for slide

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

  1. 1. Coding Mark Jaquith “JAKE-with” Scaling and @markjaquith Deploys mark@jaquith.me markjaquith.com O hM y!Friday, August 12, 11
  2. 2. Meanwhile, in 2006... Photo by Sco Beale (Laughing Squid)Friday, August 12, 11
  3. 3. Cowboy CodingFriday, August 12, 11
  4. 4. PE R! BA D! AD DE VELO B Cowboy CodingFriday, August 12, 11
  5. 5. bnj.com/cowboy-coding-pink-sombreroFriday, August 12, 11
  6. 6. VCS • or • GTFOFriday, August 12, 11
  7. 7. WordPress in your repoFriday, August 12, 11
  8. 8. My Ideal index.php wp-config.php content/themes/ content/plugins/ content/uploads/ (ignored) wp ➠ EXTERNALFriday, August 12, 11
  9. 9. Local DevelopmentFriday, August 12, 11
  10. 10. 1. MAMP, XAMPP, other 2. /etc/hosts 3. local-config.phpFriday, August 12, 11
  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. 12. Deploying — with —Friday, August 12, 11
  13. 13. 1. gem install capistrano 2. gem install railsless-deploy 3. gem install capistrano-extFriday, August 12, 11
  14. 14. releases/ current => {current-release} shared/cached-copy shared/files/Friday, August 12, 11
  15. 15. checked in: content/uploads => ../../files/uploads/ done on deploy: files => /srv/www/example.org/shared/files/Friday, August 12, 11
  16. 16. Scaling a Single ServerFriday, August 12, 11
  17. 17. nginxFriday, August 12, 11
  18. 18. proxy to Apache or PHP-FPMFriday, August 12, 11
  19. 19. PHP Opcode CacheFriday, August 12, 11
  20. 20. WP Object CacheFriday, August 12, 11
  21. 21. HTML Output Cache Batcache || W3 Total CacheFriday, August 12, 11
  22. 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. 23. MySQL Query CacheFriday, August 12, 11
  24. 24. CDN — with — Origin PullFriday, August 12, 11
  25. 25. The PlanFriday, August 12, 11
  26. 26. The Plan What happens if we outgrow our server? Boss TechFriday, August 12, 11
  27. 27. The Plan What happens if we outgrow our server? We’ll just add new Boss servers! TechFriday, August 12, 11
  28. 28. The Plan What happens if we outgrow our server? We’ll just add new Boss servers! Brilliant! TechFriday, August 12, 11
  29. 29. The PlanFriday, August 12, 11
  30. 30. The RealityFriday, August 12, 11
  31. 31. The Reality Our site is slow. Let’s add another server. Boss TechFriday, August 12, 11
  32. 32. The Reality Our site is slow. Let’s add another server. Uh... Boss TechFriday, August 12, 11
  33. 33. The Reality Our site is slow. Let’s add another server. Uh... Boss So this will take like 5 minutes, right? TechFriday, August 12, 11
  34. 34. Have a plan Not an ideaFriday, August 12, 11
  35. 35. Multiple ServersFriday, August 12, 11
  36. 36. Load BalancingFriday, August 12, 11
  37. 37. Sharing UploadsFriday, August 12, 11
  38. 38. MemcachedFriday, August 12, 11
  39. 39. Rinse & RepeatFriday, August 12, 11
  40. 40. HyperDBFriday, August 12, 11
  41. 41. Maintaining Servers with PuppetFriday, August 12, 11
  42. 42. This is the start of a larger conversationFriday, August 12, 11
  43. 43. Mark Jaquith “JAKE-with” Thanks! @markjaquith mark@jaquith.me markjaquith.comFriday, August 12, 11

×