First of all, what I have:
Linode 512
32-bit Ubuntu 10.04 LTS
Apache 2.2.14
PHP 5.3.2 with APC
MySQL 5.1.41
I'm running
http://americankpopfans.com/ for a couple friends, and they had a huge spike in users a couple days ago, and ever since then, it's been having performance issues. The original issues were due to hitting the swap hard. I realized MaxClients in Apache was way too high (it was at the default of 150), so my settings now look like this:
Code:
<IfModule mpm_prefork_module>
StartServers 1
MinSpareServers 3
MaxSpareServers 6
ServerLimit 15
MaxClients 15
MaxRequestsPerChild 3000
</IfModule>
That fixed the swap issue, but now the CPU is going berserk. It looks like this:

It's pretty much all due to MySQL, too. I've been trying to tweak it, but it doesn't seem to be helping. Here are my settings:
Code:
key_buffer = 8M
max_allowed_packet = 1M
thread_stack = 128K
thread_cache_size = 8
max_connections = 100
table_cache = 128
query_cache_limit = 1M
query_cache_size = 32M
They have a decent amount of traffic, but it's not outrageous by any means (it's on the order of 2000-6000 hits a day). I don't really know what to do right now. I've also installed
Quick Cache which is working (view the source on the homepage and scroll to the bottom). For some reason, though, it's still hitting MySQL hard and is loading super slowly. Does anyone have any ideas about what might be causing this?