High Performance WordPress II
-
Upload
barry-abrahamson -
Category
Technology
-
view
8.622 -
download
1
description
Transcript of High Performance WordPress II
![Page 1: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/1.jpg)
High Performance WordPress II
Fast and secure
![Page 2: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/2.jpg)
What I LOVE About WordPress
![Page 3: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/3.jpg)
About Me
• Barry Abrahamson
• Systems Wrangler, Automattic
• http://barry.wordpress.com/contact-me/
![Page 4: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/4.jpg)
WordPress.com
![Page 5: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/5.jpg)
WordPress.com
• Launched in August 2005
![Page 6: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/6.jpg)
WordPress.com
• Launched in August 2005
• ~9 million blogs today
![Page 7: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/7.jpg)
WordPress.com
• Launched in August 2005
• ~9 million blogs today
• Billions of HTTP requests per day
![Page 8: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/8.jpg)
WordPress.com
• Launched in August 2005
• ~9 million blogs today
• Billions of HTTP requests per day
• Billions of MySQL queries per month
![Page 9: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/9.jpg)
What is Performance?
![Page 10: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/10.jpg)
What is Performance?
• Fast
![Page 11: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/11.jpg)
What is Performance?
• Fast
• Scalable
![Page 12: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/12.jpg)
What is Performance?
• Fast
• Scalable
• Secure
![Page 13: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/13.jpg)
Lifecycle
![Page 14: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/14.jpg)
Lifecycle
• Shared hosting ( 95% )
![Page 15: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/15.jpg)
Lifecycle
• Shared hosting ( 95% )
• VPS (Virtual Private Server) ( < 5% )
![Page 16: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/16.jpg)
Lifecycle
• Shared hosting ( 95% )
• VPS (Virtual Private Server) ( < 5% )
• Dedicated Server ( < 2% )
![Page 17: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/17.jpg)
Lifecycle
• Shared hosting ( 95% )
• VPS (Virtual Private Server) ( < 5% )
• Dedicated Server ( < 2% )
• 2 Dedicated Servers ( < 1% )
![Page 18: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/18.jpg)
Lifecycle
• Shared hosting ( 95% )
• VPS (Virtual Private Server) ( < 5% )
• Dedicated Server ( < 2% )
• 2 Dedicated Servers ( < 1% )
• > 2 Dedicated Servers ( < 1% )
![Page 19: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/19.jpg)
Upgrade!
![Page 20: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/20.jpg)
Shared Hosting
![Page 21: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/21.jpg)
Shared Hosting
• FTP access (maybe SSH/SFTP)
![Page 22: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/22.jpg)
Shared Hosting
• FTP access (maybe SSH/SFTP)
• No server management overhead
![Page 23: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/23.jpg)
Shared Hosting
• FTP access (maybe SSH/SFTP)
• No server management overhead
• Less control and fewer options
![Page 24: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/24.jpg)
Shared Hosting
• FTP access (maybe SSH/SFTP)
• No server management overhead
• Less control and fewer options
• Cheap! ($4 - $20/month)
![Page 25: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/25.jpg)
Shared Hosting
![Page 26: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/26.jpg)
Shared Hosting
• Run the latest version of WordPress (easy)
![Page 27: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/27.jpg)
Shared Hosting
• Run the latest version of WordPress (easy)
• http://wordpress.org/hosting/
![Page 28: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/28.jpg)
Shared Hosting
• Run the latest version of WordPress (easy)
• http://wordpress.org/hosting/
• Plugins and Themes directory - http://wordpress.org/extend/
![Page 29: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/29.jpg)
Shared Hosting
![Page 30: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/30.jpg)
Shared Hosting
• WP Super Cache
![Page 31: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/31.jpg)
Shared Hosting
• WP Super Cache
• 25 - 50x capacity/throughput increase
![Page 32: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/32.jpg)
Shared Hosting
• WP Super Cache
• 25 - 50x capacity/throughput increase
• Digg, Slashdot, Yahoo Buzz
![Page 33: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/33.jpg)
VPS
![Page 34: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/34.jpg)
VPS
• Virtual Private Server
![Page 35: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/35.jpg)
VPS
• Virtual Private Server
• Between shared and dedicated
![Page 36: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/36.jpg)
VPS
• Virtual Private Server
• Between shared and dedicated
• Specific resources allocated to you (good and bad)
![Page 37: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/37.jpg)
VPS
• Virtual Private Server
• Between shared and dedicated
• Specific resources allocated to you (good and bad)
• Usually have shell “root” access
![Page 38: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/38.jpg)
VPS
• Virtual Private Server
• Between shared and dedicated
• Specific resources allocated to you (good and bad)
• Usually have shell “root” access
• $20 - $50 / month
![Page 39: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/39.jpg)
VPS
![Page 40: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/40.jpg)
VPS
• Run the latest version of WordPress
![Page 41: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/41.jpg)
VPS
• Run the latest version of WordPress
• WP Super Cache
![Page 42: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/42.jpg)
VPS
• Run the latest version of WordPress
• WP Super Cache
• PHP Opcode Cache (APC)
![Page 43: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/43.jpg)
VPS
• Run the latest version of WordPress
• WP Super Cache
• PHP Opcode Cache (APC)
• WordPress persistent object cache
![Page 44: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/44.jpg)
VPS
• Apache alternatives
• CDN
![Page 45: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/45.jpg)
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
![Page 46: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/46.jpg)
VPS
![Page 47: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/47.jpg)
VPS
• Apache alternatives
![Page 48: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/48.jpg)
VPS
• Apache alternatives
• CDN
![Page 49: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/49.jpg)
VPS
• Apache alternatives
• CDN
• W3 Total Cache
![Page 50: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/50.jpg)
VPS
• Apache alternatives
• CDN
• W3 Total Cache
• MySQL tweaking ( http://blog.mysqltuner.com/ )
![Page 51: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/51.jpg)
Dedicated Server
![Page 52: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/52.jpg)
Dedicated Server
• Full control
![Page 53: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/53.jpg)
Dedicated Server
• Full control
• Lots of responsibility
![Page 54: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/54.jpg)
Dedicated Server
• Full control
• Lots of responsibility
• Sysadmining required
![Page 55: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/55.jpg)
Dedicated Server
• Full control
• Lots of responsibility
• Sysadmining required
• Can be expensive ($100 - $1000 /month)
![Page 56: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/56.jpg)
2 Servers
![Page 57: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/57.jpg)
2 Servers
• Relatively easy to implement
![Page 58: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/58.jpg)
2 Servers
• Relatively easy to implement
• 1 web server, 1 database server
![Page 59: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/59.jpg)
2 Servers
• Relatively easy to implement
• 1 web server, 1 database server
• Web + database on each
![Page 60: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/60.jpg)
2 Servers
• Relatively easy to implement
• 1 web server, 1 database server
• Web + database on each
• Isolated resources
![Page 61: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/61.jpg)
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
![Page 62: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/62.jpg)
Server Farm
![Page 63: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/63.jpg)
Server Farm
• HyperDB
![Page 64: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/64.jpg)
Server Farm
• HyperDB
• Object cache with memcached backend
![Page 65: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/65.jpg)
Server Farm
• HyperDB
• Object cache with memcached backend
• Can’t use file-based caches anymore
![Page 66: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/66.jpg)
Server Farm
• HyperDB
• Object cache with memcached backend
• Can’t use file-based caches anymore
• Nananana...Batcache
![Page 67: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/67.jpg)
Server Farm
![Page 68: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/68.jpg)
Server Farm
• Load Balancer - nginx
![Page 69: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/69.jpg)
Server Farm
• Load Balancer - nginx
• Web Server - nginx
![Page 70: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/70.jpg)
Server Farm
• Load Balancer - nginx
• Web Server - nginx
• PHP - php-fpm (now an official PHP project!)
![Page 71: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/71.jpg)
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.
![Page 72: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/72.jpg)
Server Farm
![Page 73: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/73.jpg)
Server Farm
• High availability using spread and wackamole
![Page 74: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/74.jpg)
Server Farm
• High availability using spread and wackamole
• Scaling from 3 to 300 is relatively easy compared to scaling from 2 to 3.
![Page 75: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/75.jpg)
WordPress.com
• ~ 850 servers in 3 datacenters
• ~ 350 web servers
• ~ 300 database servers
• ~ 60 memcached servers (800GB of RAM)
![Page 76: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/76.jpg)
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
![Page 77: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/77.jpg)
Scaling Tips
![Page 78: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/78.jpg)
Scaling Tips
• Most (all) things you do to scale WordPress apply to any web app
![Page 79: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/79.jpg)
Scaling Tips
• Most (all) things you do to scale WordPress apply to any web app
• If your bottleneck is the database, something is wrong
![Page 80: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/80.jpg)
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
![Page 81: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/81.jpg)
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
![Page 82: High Performance WordPress II](https://reader033.fdocuments.us/reader033/viewer/2022051513/54747efdb4af9fb90a8b57be/html5/thumbnails/82.jpg)
Questions?