Optimize apache for WP use

Souljacker,

I would first take a look at your plugins. Star Ratings for Reviews hasn’t been updated for over 3 years and looks like its real heavy on the db. I saw some raw sql with some INNER JOINS that look troublesome.

On the server side you should implement some object caching. APC is the defacto standard and will give you the best results.

Once you get APC installed switch to W3 Total Cache or Mark Jaquith’s APC Object Cache Backend to take full advantage of it.

Your httpd.conf settings look fine. From the looks of your my.cnf, your not taking advantage of MySQL query caching, thread caching, or controlling any of the buffer sizes.

You can use a tuning script to help you with your my.cnf configuration. I like to use mysqltuner and tuning primer is also very good.

Mysqltuner will output suggestions and give you some guidlines on what to adjust based on your database usage.

On my server with 12G Ram my settings look like this. (Just an example don’t use these settings!!!)

key_buffer              = 512M
max_allowed_packet      = 32M
thread_stack            = 1M
thread_cache_size   = 128M

myisam-recover         = BACKUP
max_connections        = 60
table_cache            = 5000
table_definition_cache = 1024
thread_concurrency     = 16

# * Query Cache Configuration

query_cache_type        = 1
query_cache_limit       = 4M
query_cache_size        = 48M
max_heap_table_size     = 512M
tmp_table_size          = 512M
join_buffer_size        = 3M
sort_buffer_size        = 8M
read_buffer_size        = 8M
read_rnd_buffer_size    = 8M
myisam_sort_buffer_size =16M


log_slow_queries        = /var/log/mysql/mysql-slow.log
long_query_time = 1

Like others have mentioned running Nginx will drastically reduce the load on your server if your up to taking on the configurations etc. I wrote a tutorial on how to install and set up Apache with Nginx as a reverse proxy

Hope this helps.

Leave a Comment