Successfully reported this slideshow.

Scaling Dynamic WordPress Sites - WordCamp US 2015

6

Share

Loading in …3
×
1 of 14
1 of 14

Scaling Dynamic WordPress Sites - WordCamp US 2015

6

Share

Download to read offline

Page caching doesn’t work for everyone! Sites that handle a large number logged-in users like Membership sites, Multisite networks, BuddyPress sites, or bbPress forums need special treatment to scale effectively. I’ll share my experience in building and managing large Multisite networks to give tips and tricks to speeding up your dynamic websites and coding for scale.

Page caching doesn’t work for everyone! Sites that handle a large number logged-in users like Membership sites, Multisite networks, BuddyPress sites, or bbPress forums need special treatment to scale effectively. I’ll share my experience in building and managing large Multisite networks to give tips and tricks to speeding up your dynamic websites and coding for scale.

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

Scaling Dynamic WordPress Sites - WordCamp US 2015

  1. 1. Scaling Dynamic WordPress Websites WordCamp US Dec. 5th, 2015
  2. 2. Who am I? Aaron Edwards @UglyRobotDev https://profiles.wordpress.org/uglyrobot , , and CAMPUSPRESS • CTO of Incsub • WordPress developer since 2.6, specializing in Multisite • Creator of lots of plugins and services
  3. 3. One size doesn’t fit all • Most caching plugins and performance talks focus on Full Page Caching • Does nothing for dynamic websites! Membership Sites WordPress Multisite
  4. 4. Page Generation Time (ms) 0 100 200 300 400 500 600 29ms200ms300ms PHP Database Web External Google Pagespeed recommends 200ms max! Page Generation Time
  5. 5. Database Optimization • Limit and optimize queries • https://wordpress.org/plugins/query-monitor/ • Optimize MySQL config • Query cache • MySQLTuner • Convert high-write tables to InnoDB • Switch to MariaDB (10-20%) or AWS Aurora (2-3x) or keep the queries from ever getting to your DB…
  6. 6. Disk Memory WordPress Object Cache
  7. 7. Object Caching Plugins • Memcached - Recommended • http://wordpress.org/extend/plugins/memcached/ or W3TC • Redis - Recommended • https://wordpress.org/plugins/redis-cache/ • APC • https://wordpress.org/plugins/apc/ or W3TC • File Based - not recommended wp-content/object-cache.php
  8. 8. PHP Optimization: Code Profiling • Beginners: P3 (Plugin Performance Profiler) • https://wordpress.org/plugins/p3-profiler/ • Advanced: Xdebug + (web/win/k)cachegrind • Easiest way is the VVV local development environment • On Production:
  9. 9. PHP Optimization: Worst Offenders 1. Unnecessary/unoptimized queries 1. Use wp_cache_* functions (object cache required) 2. Per-pageload database writes (stats, redirection, logging plugins) 2. Watch out for remote requests! 1. Use low timeouts 2. Cache as long as possible, not in transients 3. Flushing rewrite rules poorly 4. Direct filesystem access
  10. 10. Speeding Up PHP • Use NGINX instead of Apache • In Multisite use a CDN or Varnish • Move Session storage to RAM • Upgrade PHP to 5.5 or 5.6 • Enable and configure OPcache • Make sure code base fits in cache size: • opcache.memory_consumption • opcache.max_accelerated_files • Increase revalidation frequency: • opcache.revalidate_freq
  11. 11. Switch to HHVM or PHP7! http://talks.php.net/fluent15#/wpbench
  12. 12. App Monitoring at Scale StatsD + StatsD WordPress Client + Grafana https://github.com/etsy/statsd https://wordpress.org/plugins/statsd/ http://grafana.org/ •Live application profiling
  13. 13. Too technical for you? • Hire an experienced SysAdmin • Use a cutting-edge managed WordPress host
  14. 14. Thank you #WCUS! @UglyRobotDev Drag&drop site building, 100+ WordPress plugins and 24/7 expert WordPress support

×