managing multisite: lessons from a large network
TRANSCRIPT
![Page 1: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/1.jpg)
Managing MultisiteLessons from a Large Network
William Earnhardt - @earnjam
WordCamp RaleighNovember 9, 2014
![Page 2: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/2.jpg)
Single Site vs MultisiteSingle Site Multisite
One WordPress Install ✓ ✓
One Database ✓ ✓
Supports Themes ✓ ✓
Supports Plugins ✓ ✓
Number of Websites 1 Unlimited*
*Only limited by system resources
![Page 3: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/3.jpg)
The 7 Minute Install
Step 1: Do the famous “5 Minute Install”
Step 2: Add this to wp-config.php
Step 3: Go to Tools > Network Setup
and follow instructions.
![Page 4: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/4.jpg)
Pros & Cons of MultisitePros:• Updates
• Reusability of code
• Shared Database
• Security
• Messaging
• Single Sign-On
Cons:• Updates
• Reusability of code
• Shared Database
• Security
• Single Point of Failure
![Page 5: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/5.jpg)
Should You Use Multisite?
Absolutely• A group of related sites
• Need to allow users to create new sites
Probably Not• Unrelated client sites
![Page 6: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/6.jpg)
WordPress at Carolina
Web.unc.eduSelf service web publishing for
Carolina faculty, staff, and
students.
Sites.unc.eduEnterprise web platform for
divisions, departments, schools,
and more.
![Page 7: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/7.jpg)
• www.unc.edu
• Departments
• Divisions
• Schools
• Campus Units
• Centers
• Institutes
• Research Labs
• Programs
• Collaborations
• Student Organizations
• Greek Community
• Instructional
Resources
• Services
• Faculty CVs
• Portfolios
And Much, Much
More!
What Kind of Sites?
![Page 8: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/8.jpg)
How big is “big”?
8,500 Sites
77,000
Users
![Page 9: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/9.jpg)
How big is “big”?
243 Themes
140 Plugins
![Page 10: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/10.jpg)
Infrastructure
Varnish• Bypassed for logged in users• Cache purging handled via custom plugin
3 Apache Webservers
NFS mounted shared file system • WordPress Core, themes, plugins, uploads, etc
2 MySQL servers • Replication/Hot spare• Full DB backups daily with point-in-time recovery
available from binary logs
Our Setup:
![Page 11: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/11.jpg)
InfrastructureOngoing Challenges/Lessons:
Varnish• Cache invalidation is hard
NFS• A single file system is simple, but not as fast
Apache• You should probably just should use NGINX
Database• Our databases are huge• Explore using HyperDB, or purge unused sites/tables/rows
![Page 12: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/12.jpg)
Plugins & Themes
“I’ll just use this plugin”
http://devpractic.es/post/98877425141/ill-just-use-this-plugin
![Page 13: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/13.jpg)
Selecting Themes & PluginsLicensing
• GPLv2 or compatible?• Per Domain?
Updates & Notifications• Wordpress.org vs External Repositories• Notifications only when activated
Things to Watch Out For• SHOW TABLES LIKE• switch_to_blog()• get_plugins()• eval()
WordPress.com VIP standards• http://vip.wordpress.com/documentation/code-review-what-we-
look-for/
![Page 14: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/14.jpg)
Selecting Themes & PluginsOngoing Challenges/Lessons:
Size of the codebase• Keep it simple• Only add what you truly need
Deprecate old plugins and themes• Over 2 years since last update? Find a replacement
Be picky about your plugins and themes• Thoroughly review the code• Is it in active development?• How is the support?
![Page 15: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/15.jpg)
Security
Single Site = Multisite
No FTP
Thoroughly Review Themes & Plugins
Super Admins• Limit who/how many• Set them in code with an MU Plugin
Update, Update, Update!
![Page 16: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/16.jpg)
Security
![Page 17: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/17.jpg)
Tools!Splunk• Insight into your logs
• Reporting, Alerts, etc.
• We use for PHP, Apache & ModSecurity
• Free version lets you index up to 500MB of data per day
![Page 18: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/18.jpg)
Tools!AppDynamics• Service monitoring
• Average response times
• Full call stack
• Free version stores data for last 24 hours
![Page 19: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/19.jpg)
Tools!AppDynamics
![Page 20: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/20.jpg)
Tools!AppDynamics
![Page 21: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/21.jpg)
Tools!Query Monitor• Built by John Blackbourn, current WP 4.1 development
lead
• Deep insight into each page load
Multisite Specific Plugins• Multisite Plugin Manager
• Multisite Privacy Plugin
• WordPress MU Domain Mapping
• Network Manager Tools
![Page 22: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/22.jpg)
Tools!Version Control• Git - Stash (Atlassian)• Full infrastructure builds of wp-content directory• Custom & 3rd party Themes/Plugins handled via
submodules
Local Development with Vagrant• Customized version of VVV Apache• Builds out 3 multisite environments
PHPStorm• PHP Storm 8 has full WordPress support• Xdebug• Database Connections• Version Control
![Page 23: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/23.jpg)
TakeawaysKeep it simple!• Use as few themes/plugins as you truly need
• For open network, find add-ons that get your users 90%
there
Think long term• Each decision you make will affect a lot of sites/users
down the road
• The longer something is in place, the harder it is to change
![Page 24: Managing Multisite: Lessons from a Large Network](https://reader036.vdocuments.mx/reader036/viewer/2022062515/55d5794abb61eb9f2f8b4642/html5/thumbnails/24.jpg)
Questions?