terrible performance came out of nowhere
Here's my apache conf:
<ifmodule mpm_prefork_module="">StartServers 1
MinSpareServers 3
MaxSpareServers 6
ServerLimit 15
MaxClients 15
MaxRequestsPerChild 3000</ifmodule>
I've got a Linode 512, and I'm running 32-bit Ubuntu 10.04 LTS, all updates are current. Memory usage is fine, swap usage is essentially nil, as is general I/O. CPU usage is really low, too (uptime: 11:07:45 up 1 day, 0 min, 1 user, load average: 0.05, 0.05, 0.05).
The problem I think is bandwidth usage. Here's a graph of the last 30 days:
~~![](<URL url=)http://i.imgur.com/8FGor.png
And the last 24 hours:
~~![](<URL url=)http://i.imgur.com/kJQdi.png
You can see that my bandwidth usage was really low until just a few days ago. There hasn't been a significant increase in the number of unique visitors to my site, so I don't know what's going on here. Does anyone have any advice? This is incredibly frustrating.~~~~
8 Replies
@Fangs404:
I'm experiencing some awful performance on my server. (…) Memory usage is fine, swap usage is essentially nil, as is general I/O. CPU usage is really low, too (…)
By awful performance I am assuming page load time? Increase Apache MaxClients and ServerLimit to, say, 32 and observe what happens. Keep in mind, though, that will double the memory consumption of your apache/php processes so make sure there's room for that, or increase in smaller steps. Also fully restart httpd, reload won't catch MPM config changes.
Also install Munin, Apache plugin and corelate number of busy processes with memory/cpu/bandwidth usage. That way you'll know better what's going on.
Increasing MaxClients seemed to help quite a bit. I'm setting Munin up now. I'm using quite a bit of swap now that MaxClients is increased (I bumped it to 30). A Linode 512 should be able to handle the kind of load I'm getting just fine.
Via mobile device…
Short-term solution: Disable KeepAlive.
Long-term solution: Offload your /wordpress/wp-content/uploads directory to another web server like nginx (or a CDN). This will leave Apache with some breathing room to serve PHP scripts more efficiently.
Many of the images you are using are not very optimized for quick loading.
Example:
Which is a large 800x300 image you use on the main page. It is physically 754kb in size. It is taking 18197 ms to download.
Optimizing the image (still same size in pixels) got it down to 30kb. That is 25x smaller and would load significantly faster.
A lot of your other images are much larger than you are using them on the site. While they are small on the site, you are still loading the full sized images and having the visitors browser resize them down. This is both using more bandwidth (slower download) but also results in less quality images (browser resize based on speed not quality).
Example:
Actual image is 600x880, you are using it on the website as 280x350. At over 500kb, the actual size if you reduced it would be under 20kb.
A little content optimization can go a long way.
Offloading your content as suggested above is a good idea too, but if the images are large, they are going to load slower.
check your logs, see if there are any errors. Did you update your site recently?