enterprise-scale wordpress
TRANSCRIPT
Enterprise-Scale WordPress
K E A N A N KO P P E N H AV E R
@KKOPPENHAVER
HTTP://GITHUB.COM/KKOPPENHAVER
HTTP://LEVELUPWP.NET
Who Am I?
• Developer at doejo
• Been working primarily on WP projects for the past 3 years
• Scaling up from small marketing sites
What is WordPress VIP?
• Managed Hosting by Automattic
• Serves just over 22 billion page views/month
• Includes Security, Code Review, and much more
• Hosted on the same platform that powers millions of blogs on WordPress.com
WordPress.Com Serves 70,000 Req/Sec And Over 15 Gbit/Sec Of Traffic (2012)
Source: http://highscalability.com/blog/2012/9/26/wordpresscom-serves-70000-reqsec-and-over-15-gbitsec-of-traf.html
What kind of traffic are we talking about?
• 4-6 million pageviews / month
• 20,000 page views / hour (during the work day)
• 5 page views every second (among 100s of concurrent connections)
Enterprise-Scale
KEANAN’S MACBOOK
HTTP://DEV.KK.COM
HTTP://QA.KK.COM
HTTP://BETA.KK.COM
HTTP://KK.COM
Enterprise-Scale
KK-PROD1
KK-PROD2
KK-PROD3
KEANAN’S MACBOOK
Load Balancer Icon by Alex WaZa for Noun Project
HTTP://KK.COM
Servers are busy
• Serving static assets (HTML/CSS/JS/JPG/PNG/PDF, etc…)
• Processing and serving all needed PHP templates
• Making MySQL calls
Enterprise-Scale
KK-PROD1
KK-PROD2
KK-PROD3
KEANAN’S MACBOOK
Load Balancer Icon by Alex WaZa for Noun Project
HTTP://KK.COM
Servers are busy
• Serving static assets (HTML/CSS/JS/JPG/PNG/PDF, etc…)
• Processing and serving all needed PHP templates
• Making MySQL calls
Front End Caching• Cache stored on the user’s machine
• Specified expiration date when the asset is “stale”
• Saves the server from serving these assets that don’t change
• Advanced Mode: Cache busting URL string
• Super Advanced Mode: CDN
https://memcached.org/
Memcached is…often used to speed up dynamic database-driven websites by caching data and
objects in RAM to reduce the number of times an external data source (such as a database or API)
must be read.
Backend Caching
• Memcached saves web server and database server
• Prevents blocking DB calls
• Must be flushed when changes are made
Phil Carlton, Tim Bray, Jeff Atwood, and many others
There are two hard things in computer science: cache invalidation, naming things, and off-by-one
errors.
Version Control
• Git (Command Line or Source Tree)
• Branches are important
• Tie branches and commits to tickets
• You may need…
Code Review
• Peer review of your commits
• Included with WP VIP
• Useful double check
• Useful for learning across the team
Automated Deployments
• No more manual FTP
• Deploy from Version Control
• Ensure pre- and post-deployment steps are the same every time
• Deployment == One Less Thing To Think About
DON’T: Dump everything in functions.php
• Multiple files with grouped functions
• Namespacing
• Sanity when Searching
• lib/*
DON’T: Dump everything in functions.php (Part 2)
• Bigger than a group of functions? Feature Plugin.
• Pros: Can be maintained independently
• Cons: Has to be maintained independently
DO: Keep request count low
• Ad Networks, Analytics, Social Integration, etc
• Maximum simultaneous connections (per browser)
• Think of the mobile users
• Luckily, Dev Tools has your back
Questions?K E A N A N KO P P E N H AV E R
@KKOPPENHAVER
HTTP://GITHUB.COM/KKOPPENHAVER
HTTP://LEVELUPWP.NET