Question
Apache getting hammered... Wordpress site. CPU 100%
Hi folks. I hope one of your gurus can point me in the right direction.
I have two servers, one for Apache and one for MySQL, 4GB and 2GB RAM respectively. They run about 10 wordpress sites with very low traffic, and resources have not been a problem.
I now added another WP site with about 3000 pageviews per day and the server that runs Apache is sitting at 100% CPU all the time. Page load speed is dismal, somewhere around 6 seconds.
The site is www.fairtattoo.com. It has about 5000 posts currently.
Plugins are W3Total Cache, SEO by Yoast, WP Optimize. The theme is a professional theme from mythemeshop (truepixel) and I have used it without a problem on other sites.
Apache uses mpm_prefork.
Strangely, apache will use only about half the available RAM, approx 2GB of teh 4GB available. I’ve tried tweaking mpm_prefork with a few variations, but no luck so far.
Here’s the mpm_prefork:
<IfModule mpm_prefork_module>
# Default 5
StartServers 5
# Default 5
MinSpareServers 5
# Default 10
MaxSpareServers 10
# default 256
ServerLimit 256
# default 256, less or same as Server Limit
MaxRequestWorkers 256
# deprecated: Called MaxRequestWorkers now
#MaxClients 128
# Can be a high number like 20000 but do not set to 0 (unlimited)
MaxConnectionsPerChild 20000
# No need to Keep alive, just keeps threads busy
KeepAlive On
Where next? How to diagnose?
Thanks in advance
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Oh, the problem isn’t with the DB as far as I can tell. The DB server sits idle most of the time and the total query time for a page is under 1s. You can see the query time value at the bottom left of each page in the footer.
Glad you found the problem and the solution, but your setup sounds like it might be overkill, unless you really need to actual disk storage space. And having the db server on a different droplet makes no sense - even if on the same private network, you’ll be adding so much latency.
Have a look at my post here - https://www.digitalocean.com/community/questions/i-have-many-domains-should-i-get-one-droplet-at-80-month-or-a-couple-at-20month?answer=19750
You could probably get away with it all on one $20 droplet with the right tweaking. Just sayin’....
Would you like to tweak it for me? What would that cost?
Edge Side Includes: http://en.wikipedia.org/wiki/Edge_Side_Includes