Upload
barry-abrahamson
View
8.622
Download
1
Embed Size (px)
DESCRIPTION
High Performance WordPress Presentation from WordCamp Orlando 2009
Citation preview
High Performance WordPress II
Fast and secure
What I LOVE About WordPress
About Me
• Barry Abrahamson
• Systems Wrangler, Automattic
• http://barry.wordpress.com/contact-me/
WordPress.com
WordPress.com
• Launched in August 2005
WordPress.com
• Launched in August 2005
• ~9 million blogs today
WordPress.com
• Launched in August 2005
• ~9 million blogs today
• Billions of HTTP requests per day
WordPress.com
• Launched in August 2005
• ~9 million blogs today
• Billions of HTTP requests per day
• Billions of MySQL queries per month
What is Performance?
What is Performance?
• Fast
What is Performance?
• Fast
• Scalable
What is Performance?
• Fast
• Scalable
• Secure
Lifecycle
Lifecycle
• Shared hosting ( 95% )
Lifecycle
• Shared hosting ( 95% )
• VPS (Virtual Private Server) ( < 5% )
Lifecycle
• Shared hosting ( 95% )
• VPS (Virtual Private Server) ( < 5% )
• Dedicated Server ( < 2% )
Lifecycle
• Shared hosting ( 95% )
• VPS (Virtual Private Server) ( < 5% )
• Dedicated Server ( < 2% )
• 2 Dedicated Servers ( < 1% )
Lifecycle
• Shared hosting ( 95% )
• VPS (Virtual Private Server) ( < 5% )
• Dedicated Server ( < 2% )
• 2 Dedicated Servers ( < 1% )
• > 2 Dedicated Servers ( < 1% )
Upgrade!
Shared Hosting
Shared Hosting
• FTP access (maybe SSH/SFTP)
Shared Hosting
• FTP access (maybe SSH/SFTP)
• No server management overhead
Shared Hosting
• FTP access (maybe SSH/SFTP)
• No server management overhead
• Less control and fewer options
Shared Hosting
• FTP access (maybe SSH/SFTP)
• No server management overhead
• Less control and fewer options
• Cheap! ($4 - $20/month)
Shared Hosting
Shared Hosting
• Run the latest version of WordPress (easy)
Shared Hosting
• Run the latest version of WordPress (easy)
• http://wordpress.org/hosting/
Shared Hosting
• Run the latest version of WordPress (easy)
• http://wordpress.org/hosting/
• Plugins and Themes directory - http://wordpress.org/extend/
Shared Hosting
Shared Hosting
• WP Super Cache
Shared Hosting
• WP Super Cache
• 25 - 50x capacity/throughput increase
Shared Hosting
• WP Super Cache
• 25 - 50x capacity/throughput increase
• Digg, Slashdot, Yahoo Buzz
VPS
VPS
• Virtual Private Server
VPS
• Virtual Private Server
• Between shared and dedicated
VPS
• Virtual Private Server
• Between shared and dedicated
• Specific resources allocated to you (good and bad)
VPS
• Virtual Private Server
• Between shared and dedicated
• Specific resources allocated to you (good and bad)
• Usually have shell “root” access
VPS
• Virtual Private Server
• Between shared and dedicated
• Specific resources allocated to you (good and bad)
• Usually have shell “root” access
• $20 - $50 / month
VPS
VPS
• Run the latest version of WordPress
VPS
• Run the latest version of WordPress
• WP Super Cache
VPS
• Run the latest version of WordPress
• WP Super Cache
• PHP Opcode Cache (APC)
VPS
• Run the latest version of WordPress
• WP Super Cache
• PHP Opcode Cache (APC)
• WordPress persistent object cache
VPS
• Apache alternatives
• CDN
Apache + mod_php
• Using mod_php, php is loaded for every request even if not needed
• Most scaling problems are because of this
1 request requiring php
VPS
VPS
• Apache alternatives
VPS
• Apache alternatives
• CDN
VPS
• Apache alternatives
• CDN
• W3 Total Cache
VPS
• Apache alternatives
• CDN
• W3 Total Cache
• MySQL tweaking ( http://blog.mysqltuner.com/ )
Dedicated Server
Dedicated Server
• Full control
Dedicated Server
• Full control
• Lots of responsibility
Dedicated Server
• Full control
• Lots of responsibility
• Sysadmining required
Dedicated Server
• Full control
• Lots of responsibility
• Sysadmining required
• Can be expensive ($100 - $1000 /month)
2 Servers
2 Servers
• Relatively easy to implement
2 Servers
• Relatively easy to implement
• 1 web server, 1 database server
2 Servers
• Relatively easy to implement
• 1 web server, 1 database server
• Web + database on each
2 Servers
• Relatively easy to implement
• 1 web server, 1 database server
• Web + database on each
• Isolated resources
2 Servers
• Relatively easy to implement
• 1 web server, 1 database server
• Web + database on each
• Isolated resources
• Same as single server from an application perspective but now you have to worry about network bottlenecks
Server Farm
Server Farm
• HyperDB
Server Farm
• HyperDB
• Object cache with memcached backend
Server Farm
• HyperDB
• Object cache with memcached backend
• Can’t use file-based caches anymore
Server Farm
• HyperDB
• Object cache with memcached backend
• Can’t use file-based caches anymore
• Nananana...Batcache
Server Farm
Server Farm
• Load Balancer - nginx
Server Farm
• Load Balancer - nginx
• Web Server - nginx
Server Farm
• Load Balancer - nginx
• Web Server - nginx
• PHP - php-fpm (now an official PHP project!)
Server Farm
• Load Balancer - nginx
• Web Server - nginx
• PHP - php-fpm (now an official PHP project!)
• Database - Basic MySQL replication, leave all the complicated stuff to HyperDB.
Server Farm
Server Farm
• High availability using spread and wackamole
Server Farm
• High availability using spread and wackamole
• Scaling from 3 to 300 is relatively easy compared to scaling from 2 to 3.
WordPress.com
• ~ 850 servers in 3 datacenters
• ~ 350 web servers
• ~ 300 database servers
• ~ 60 memcached servers (800GB of RAM)
Real World Numbers
• APC
• Empty cache - 33.5 MB RAM
• Primed cache - 6.2 MB RAM
• 60% reduction in CPU utilization
• 210 8-core servers on WordPress.com
Scaling Tips
Scaling Tips
• Most (all) things you do to scale WordPress apply to any web app
Scaling Tips
• Most (all) things you do to scale WordPress apply to any web app
• If your bottleneck is the database, something is wrong
Scaling Tips
• Most (all) things you do to scale WordPress apply to any web app
• If your bottleneck is the database, something is wrong
• Measure twice, cut once, measure again
Scaling Tips
• Most (all) things you do to scale WordPress apply to any web app
• If your bottleneck is the database, something is wrong
• Measure twice, cut once, measure again
• Don’t optimize if you don’t need to
Questions?