Advertisement
Advertisement

More Related Content

Viewers also liked(20)

Advertisement

Scaling Dynamic WordPress Sites - WordCamp US 2015

  1. Scaling Dynamic WordPress Websites WordCamp US Dec. 5th, 2015
  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. 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. 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. 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. Disk Memory WordPress Object Cache
  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. 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. 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. 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. Switch to HHVM or PHP7! http://talks.php.net/fluent15#/wpbench
  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. Too technical for you? • Hire an experienced SysAdmin • Use a cutting-edge managed WordPress host
  14. Thank you #WCUS! @UglyRobotDev Drag&drop site building, 100+ WordPress plugins and 24/7 expert WordPress support
Advertisement