High Performance Wordpress
-
Upload
gareth-davies -
Category
Technology
-
view
4.954 -
download
0
description
Transcript of High Performance Wordpress
![Page 1: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/1.jpg)
High Performance WordPress
Gareth Davies
![Page 2: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/2.jpg)
Why performance?
•Speed
•so people don’t wait
•Scale
•serve as many requests to as many people as possible, concurrently
![Page 3: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/3.jpg)
LAMP
•A stack
•LAMP
•Linux
•Apache
•MySQL
•PHP
![Page 4: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/4.jpg)
WordPress
•Written in PHP
•Uses MySQL as the database
•Apache/nginx can be used for HTTP
![Page 5: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/5.jpg)
WordPress
•Core (installed)
•Themes
•Plugins
![Page 6: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/6.jpg)
OS Level Tuning
•You’re 64-bit by now
•Log errors, and nothing else
•TCP/IP settings
•Only run services that you need on a server
![Page 7: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/7.jpg)
OS Level Tuning
•Simple firewall to stop bots
•Read log files from logwatch -- hardware dies too
•vmem.sh
•Filesystem - XFS is best, EXT3, EXT4 are OK too
![Page 8: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/8.jpg)
Apache
•Tune Apache (httpd.conf)
•ab & httperf
•MaxClients
•Defaults are usually horrible
![Page 9: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/9.jpg)
MySQL•Defaults are terrible, use my.cnf
•mysqltuner.pl, tuningprimer.sh
•mytop
•Use maatkit + mk-query-digest
• See general & slow query log (for your plugin problems)
• InnoDB is better for concurrency, though by default you’re probably using MyISAM
•mysqlslap for benchmarking
![Page 10: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/10.jpg)
PHP
•Memory settings
•Opcode cache
•XCache, EAccelerator, APC
•php.ini
![Page 11: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/11.jpg)
WordPress
•Plugins are often horribly coded
•Themes can have direct calls to the database
![Page 12: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/12.jpg)
WordPress
•Look at wp_options tables
•Disable plugins
•Try the new Twenty Ten theme
•wp_config.php: WP_HOME, WP_SITEURL
![Page 13: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/13.jpg)
Still struggling?
•Content Delivery Networks (CDN)
•Minify
•Caching
![Page 14: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/14.jpg)
WP Caches
•WP Super Cache
•W3 Total Cache
![Page 15: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/15.jpg)
More you can do
•use mod_proxy and serve static content
•CDN: Amazon S3+CloudFront is affordable
•use browser cache (set long expires)
![Page 16: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/16.jpg)
Separate machines
•2 machines
•web server
•database server
•memcached servers?
![Page 17: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/17.jpg)
Varnish
•Varnish serves everything from memory
•httpd on a different port, run varnish on port 80 and point it to httpd port
![Page 18: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/18.jpg)
Further growth
•Its now time to think about MySQL replication (master-slave setups)
•memcached to keep caches of query results (up to 1M) in memory
•HyperDB supports data partitioning, and can read from multiple databases
![Page 19: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/19.jpg)
WordPress.COM
•several billion HTTP queries per day, billions of MySQL queries too
•HP hardware, all SSD
![Page 20: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/20.jpg)
HipHop from Facebook
•http://huichen.org/en/2010/06/wordpress-3-benchmark/
•http://huichen.org/en/2010/06/wordpress-3-benchmark-part-2/
•~2.7x improvement in performance
![Page 21: High Performance Wordpress](https://reader035.fdocuments.net/reader035/viewer/2022070315/554ddb63b4c905cc0e8b5031/html5/thumbnails/21.jpg)
Find Me
•@ShaolinTiger on Twitter
•http://www.shaolintiger.com – My Blog
•shaolintiger at gmail – Email me