Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Scaling	Dynamic
WordPress	Websites
WordCamp	US																																																																		Dec.	5th,	...
Who	am	I?
Aaron	Edwards	
@UglyRobotDev	
https://profiles.wordpress.org/uglyrobot
																															,									...
One	size	doesn’t	fit	all
• Most	caching	plugins	and	performance	talks	
focus	on	Full	Page	Caching	
• Does	nothing	for	dyna...
Page	Generation	Time	(ms)
0 100 200 300 400 500 600
29ms200ms300ms
PHP Database Web	External
Google	Pagespeed	recommends	2...
Database	Optimization
• Limit	and	optimize	queries	
• https://wordpress.org/plugins/query-monitor/	
• Optimize	MySQL	confi...
Disk
Memory
WordPress	Object	Cache
Object	Caching	Plugins
• Memcached	-	Recommended	
• http://wordpress.org/extend/plugins/memcached/	or	W3TC	
• Redis	-	Reco...
PHP	Optimization:	Code	Profiling
• Beginners:	P3	(Plugin	Performance	Profiler)	
• https://wordpress.org/plugins/p3-profile...
PHP	Optimization:	Worst	Offenders
1. Unnecessary/unoptimized	queries	
1. Use	wp_cache_*	functions	(object	cache	required)	...
Speeding	Up	PHP
• Use	NGINX	instead	of	Apache	
• In	Multisite	use	a	CDN	or	Varnish	
• Move	Session	storage	to	RAM	
• Upgra...
Switch	to	HHVM	or	PHP7!
http://talks.php.net/fluent15#/wpbench
App	Monitoring	at	Scale
StatsD	+	StatsD	
WordPress	Client	+	
Grafana	
https://github.com/etsy/statsd	
https://wordpress.or...
Too	technical	for	you?
• Hire	an	experienced	SysAdmin	
• Use	a	cutting-edge	managed	WordPress	host
Thank	you	#WCUS!	
@UglyRobotDev
Drag&drop	site	building,	100+	WordPress	plugins	and	24/7	expert	
WordPress	support
Upcoming SlideShare
Loading in …5
×

Scaling Dynamic WordPress Sites - WordCamp US 2015

6,152 views

Published on

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.

Published in: Technology

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

×