9. Web Server
nginx LiteSpeed
http://nginx.net/ http://litespeedtech.com/
lighttpd Zeus
http://www.lighttpd.net/ http://www.zeus.com/
10. Apache
• Can be a pig, remove any modules you aren’t
using
• Turn off host name lookups
• Turn on compression (mod_deflate)
• Turn off FollowSymLinks (and .htaccess if you
can)
• Skip Apache all together, serve static content
from another server
11. PHP
• Use an opcode cache (APC, lots of others)
• Don’t use on static files (unless you really,
really need to)
• Consider output buffering
• Be careful with preg_* functions
12. MySQL - Table Types
MyISAM
• High performance reads or writes, not
both
• Full text search
InnoDB
• Better for mixed reads/writes
• Transactions, Foreign Keys
13. MySQL
• Double (and triple) check indexes
• Tune your configuration
• key_buffer_size, table_cache,
sort_buffer_size, read_buffer_size
• Replication (more on that later)
• Interesting quirks, get familiar with them
15. WordPress
• MySQL tables default to using MyISAM,
consider using InnoDB instead
• Turn off unused plugins
• Check that themes and plugins aren’t abusing
MySQL or PHP
• Server static content from another server
(optimized for that task)
16. Construction
Start from the bottom and
work your way up
17. Test Setup
• Ubuntu 9.04 server edition
• Apache 2.2.11
• PHP 5.2.6
• MySQL 5.0.75
• WordPress -trunk
27. WordPress + Memcache
• Ryan Boren
• Stores WordPress data in Memcache
• Reduces the number of database queries
• http://ryan.wordpress.com/2005/12/23/
memcached-backend/
33. WordPress
+ WP Super Cache
• Donncha O Caoimh
• Stores rendered HTML on disk
• http://wordpress.org/extend/plugins/wp-super-
cache/
34. Let me 'splain. ...
No, there is too much. Let me sum up.
Requests Seconds per
Description Potential
per Second request (mean)
Zero Bytes 80 ~0.01 -
Static phpinfo() 75 ~0.04 100%
phpinfo() 69 ~0.04 92%
OOB WP 6 ~7.00 8%
WP & APC 22 ~1.51 29%
WP & APC/
24 ~1.40 32%
Memcache
WP & APC/
60 ~0.04 80%
Memcache/Batcache
40. MySQL Replication
• Master / Slave - one way asynchronous
• Send writes to the master, reads to the
slave(s)
• Replication works on both MyISAM and
InnoDB tables
• Supports multiple slaves and replication
chaining
41. Enter HyperDB
• Drop in replacement for the default
WordPress database class
• Supports distributed reads/writes
• Partition data (helpful for large WPMU
installs)
• Failover support when a database goes down
• http://codex.wordpress.org/HyperDB