82
High Performance WordPress II Fast and secure

High Performance WordPress II

Embed Size (px)

DESCRIPTION

High Performance WordPress Presentation from WordCamp Orlando 2009

Citation preview

Page 1: High Performance WordPress II

High Performance WordPress II

Fast and secure

Page 2: High Performance WordPress II

What I LOVE About WordPress

Page 3: High Performance WordPress II

About Me

• Barry Abrahamson

• Systems Wrangler, Automattic

• http://barry.wordpress.com/contact-me/

Page 4: High Performance WordPress II

WordPress.com

Page 5: High Performance WordPress II

WordPress.com

• Launched in August 2005

Page 6: High Performance WordPress II

WordPress.com

• Launched in August 2005

• ~9 million blogs today

Page 7: High Performance WordPress II

WordPress.com

• Launched in August 2005

• ~9 million blogs today

• Billions of HTTP requests per day

Page 8: High Performance WordPress II

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

What is Performance?

Page 10: High Performance WordPress II

What is Performance?

• Fast

Page 11: High Performance WordPress II

What is Performance?

• Fast

• Scalable

Page 12: High Performance WordPress II

What is Performance?

• Fast

• Scalable

• Secure

Page 13: High Performance WordPress II

Lifecycle

Page 14: High Performance WordPress II

Lifecycle

• Shared hosting ( 95% )

Page 15: High Performance WordPress II

Lifecycle

• Shared hosting ( 95% )

• VPS (Virtual Private Server) ( < 5% )

Page 16: High Performance WordPress II

Lifecycle

• Shared hosting ( 95% )

• VPS (Virtual Private Server) ( < 5% )

• Dedicated Server ( < 2% )

Page 17: High Performance WordPress II

Lifecycle

• Shared hosting ( 95% )

• VPS (Virtual Private Server) ( < 5% )

• Dedicated Server ( < 2% )

• 2 Dedicated Servers ( < 1% )

Page 18: High Performance WordPress II

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

Upgrade!

Page 20: High Performance WordPress II

Shared Hosting

Page 21: High Performance WordPress II

Shared Hosting

• FTP access (maybe SSH/SFTP)

Page 22: High Performance WordPress II

Shared Hosting

• FTP access (maybe SSH/SFTP)

• No server management overhead

Page 23: High Performance WordPress II

Shared Hosting

• FTP access (maybe SSH/SFTP)

• No server management overhead

• Less control and fewer options

Page 24: High Performance WordPress II

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

Shared Hosting

Page 26: High Performance WordPress II

Shared Hosting

• Run the latest version of WordPress (easy)

Page 27: High Performance WordPress II

Shared Hosting

• Run the latest version of WordPress (easy)

• http://wordpress.org/hosting/

Page 28: High Performance WordPress II

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

Shared Hosting

Page 31: High Performance WordPress II

Shared Hosting

• WP Super Cache

• 25 - 50x capacity/throughput increase

Page 32: High Performance WordPress II

Shared Hosting

• WP Super Cache

• 25 - 50x capacity/throughput increase

• Digg, Slashdot, Yahoo Buzz

Page 33: High Performance WordPress II

VPS

Page 34: High Performance WordPress II

VPS

• Virtual Private Server

Page 35: High Performance WordPress II

VPS

• Virtual Private Server

• Between shared and dedicated

Page 36: High Performance WordPress II

VPS

• Virtual Private Server

• Between shared and dedicated

• Specific resources allocated to you (good and bad)

Page 37: High Performance WordPress II

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

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

VPS

Page 40: High Performance WordPress II

VPS

• Run the latest version of WordPress

Page 41: High Performance WordPress II

VPS

• Run the latest version of WordPress

• WP Super Cache

Page 42: High Performance WordPress II

VPS

• Run the latest version of WordPress

• WP Super Cache

• PHP Opcode Cache (APC)

Page 43: High Performance WordPress II

VPS

• Run the latest version of WordPress

• WP Super Cache

• PHP Opcode Cache (APC)

• WordPress persistent object cache

Page 44: High Performance WordPress II

VPS

• Apache alternatives

• CDN

Page 45: High Performance WordPress II

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

VPS

Page 47: High Performance WordPress II

VPS

• Apache alternatives

Page 48: High Performance WordPress II

VPS

• Apache alternatives

• CDN

Page 49: High Performance WordPress II

VPS

• Apache alternatives

• CDN

• W3 Total Cache

Page 50: High Performance WordPress II

VPS

• Apache alternatives

• CDN

• W3 Total Cache

• MySQL tweaking ( http://blog.mysqltuner.com/ )

Page 51: High Performance WordPress II

Dedicated Server

Page 52: High Performance WordPress II

Dedicated Server

• Full control

Page 53: High Performance WordPress II

Dedicated Server

• Full control

• Lots of responsibility

Page 54: High Performance WordPress II

Dedicated Server

• Full control

• Lots of responsibility

• Sysadmining required

Page 55: High Performance WordPress II

Dedicated Server

• Full control

• Lots of responsibility

• Sysadmining required

• Can be expensive ($100 - $1000 /month)

Page 56: High Performance WordPress II

2 Servers

Page 57: High Performance WordPress II

2 Servers

• Relatively easy to implement

Page 58: High Performance WordPress II

2 Servers

• Relatively easy to implement

• 1 web server, 1 database server

Page 59: High Performance WordPress II

2 Servers

• Relatively easy to implement

• 1 web server, 1 database server

• Web + database on each

Page 60: High Performance WordPress II

2 Servers

• Relatively easy to implement

• 1 web server, 1 database server

• Web + database on each

• Isolated resources

Page 61: High Performance WordPress II

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

Server Farm

Page 67: High Performance WordPress II

Server Farm

Page 68: High Performance WordPress II

Server Farm

• Load Balancer - nginx

Page 69: High Performance WordPress II

Server Farm

• Load Balancer - nginx

• Web Server - nginx

Page 70: High Performance WordPress II

Server Farm

• Load Balancer - nginx

• Web Server - nginx

• PHP - php-fpm (now an official PHP project!)

Page 71: High Performance WordPress II

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

Server Farm

Page 73: High Performance WordPress II

Server Farm

• High availability using spread and wackamole

Page 74: High Performance WordPress II

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

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

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

Scaling Tips

Page 78: High Performance WordPress II

Scaling Tips

• Most (all) things you do to scale WordPress apply to any web app

Page 79: High Performance WordPress II

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

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

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

Questions?