Question

Apache getting hammered... Wordpress site. CPU 100%

  • Posted on January 30, 2015
  • varangeAsked by varange

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

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Also, as a quid pro quo, I thought I’d describe to other readers of this thread how to get Theme-My-Login to disable wp-login.php.

Step 1: Install Theme My Login. Just look for a new plugin from your wordpress admin console Step 2: Enable the Security Module from TML Settings

http://www.fairtattoo.com/wordpress/wp-content/uploads/2015/01/tml_enable_security.png

Step 3: Go to the Security Module’s settings and “Disable wp-login”

http://www.fairtattoo.com/wordpress/wp-content/uploads/2015/01/tml_disable_wp-login.png

That’s it!

I also like to set up Recaptcha. Easy enough to do.

PS: Jonathan, would you link to the media files in this comment please? No idea how to do that.

Good thought! I installed Theme-My-Login, and that redirects and puts Recaptchas whereever I want them

https://wordpress.org/plugins/theme-my-login/

OK, found the problem!

The THEME! Really, no jokes. Who woulda thought?

I load a different theme (twenty-fifteen) and life is good.

Goes to show.