[wp-hackers] 5 minutes to a faster blog
Sebastian Herp
newsletter at scytheman.net
Fri Dec 1 15:11:22 GMT 2006
I tried to increase performance, too ... and found out the following things:
- eAccelerator (and any other PHP-Accelerator) increaseed performance 2x
often 3x (depending on the script that runs, frontpage = 2x)
- enabling the mysql query cache helped a lot, but only if the $now in
the posts-query gets frozen
(http://comox.textdrive.com/pipermail/wp-hackers/2006-January/003885.html),
otherwise the frontpage doesn't benefit too much from it
- switching to innodb actually decreased performance (nearly not
measureable) on my install, but maybe my blog is too small with its 1500
posts
- enabling the built in cache decreased performance by 10%. So I guess
my HD is simply too slow :-)
hdparm -tT /dev/md0
/dev/md0:
Timing cached reads: 1908 MB in 2.00 seconds = 953.94 MB/sec
Timing buffered disk reads: 146 MB in 3.02 seconds = 48.28 MB/sec
- deactivating the gzip compression in the wp options panel increased
performance a little bit
- activating wp-cache (the plugin) increased performance by a factor of
6 (on my blog from 5 request per second to 30 request per second)
Did I forget anything?
Matt Mullenweg wrote:
> With the following I regularly get sub 100 millisecond front-page
> generation time on photomatt.net, and lower on WP Pages. No caching
> plugins, no alternative front-ends that make me rewrite my themes and
> plugins, just plain WordPress.
>
> 1. Use APC:
>
> http://pecl.php.net/package/APC
>
> APC can give you a 3x speedup in load times, instantly.
>
> Tip: If you're on Litespeed, use this to save memory:
>
> http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:php:opcode_cache
>
>
> (APC is bundled with Litespeed, btw.)
>
> 2. Enable the query cache:
>
> nano /etc/my.cnf
>
> [mysqld]
> ...
> query_cache_size = 64M
>
> /etc/init.d/mysql restart
>
> This usually cuts in half most SQL times on busy sites, if not more.
>
> 3. Swich your tables to InnoDB
>
> Use phpMyAdmin > table > Operations to switch.
>
> And add the following in your MySQL config file, adjust sizes as
> necessary for your memory:
>
> # Make buffer_pool larger than the size of your DB, if possible
> innodb_buffer_pool_size=512M
> innodb_additional_mem_pool_size=20M
> innodb_flush_log_at_trx_commit=0
> innodb_log_buffer_size=8M
>
> Restart MySQL.
>
> 4. Enable WP's built-in caching
>
> define( 'ENABLE_CACHE', true ); // in wp-config.php
>
> Unless you have slow HDs, like a NFS-based host like Dreamhost.
>
> == More than 5 minutes, bonus ==
>
> 5. Use WP 2.1
>
> It's way faster.
>
More information about the wp-hackers
mailing list