Thanks for posting that. Confirms what I was thinking. Based on your top, your mySQL is fine (could use a bit more tweaking), but your Apache settings are now in need of some adjustment. You have a lot of Apache threads open which means that Apache is probably hanging on to connections too long. First, let's tweak mySQL a bit more. Change your mySQL configuration to the following:
Code:
[mysqld]
datadir=/var/lib/mysql
skip-locking
safe-show-database
query_cache_limit=3M
query_cache_size=256M
query_cache_type=1
query_prealloc_size = 163840
query_alloc_block_size = 32768
max_user_connections=300
max_connections=500
interactive_timeout=10
wait_timeout=20
connect_timeout=10
thread_cache_size=384
key_buffer=256M
join_buffer=1M
max_connect_errors=20
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=8M
read_buffer_size=8M
read_rnd_buffer_size=8M
thread_concurrency=16
myisam_sort_buffer_size=64M
server-id=1
[mysql.server]
user=mysql
[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=8192
[mysqldump]
quick
max_allowed_packet=16M
[mysql]
no-auto-rehash
This will give you a bit more performance out of mySQL. Be sure to restart mySQL after making the change.
Next, for Apache, find the following lines in your httpd.conf and change them to:
Code:
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 5
MinSpareServers 10
MaxSpareServers 20
StartServers 15
MaxClients 180
MaxRequestsPerChild 1000
Restart Apache after making that change and see if your load decreases.
Bookmarks