CPU spikes in Apache


I have 6 wordpress websites running on my Ubuntu Linode. Now frequently Longview sees Apache2 spiking 100% CPU which causes slow website performance.

My guess it's a plugin or basically just one wordpress installation that causes it. My question is how can I find out which out of the 6 domains is causing this CPU spike?

It's been going on for a few days now…

Many thanks,



![](http://www.seomandarin.com/wp-content/u … w91894.jpg">http://www.seomandarin.com/wp-content/uploads/Linode-Longview-longview91894.jpg" />

3 Replies

Use a different apache log file for each virtual domain. Then look at /var/log/apache2 and most likely you will find a correlation between high CPU usage and some pattern of web requests.

In either case, if you are only using WordPress, try nginx + php5-fpm.

I've checked all logfiles per domain without any pattern that could result in high CPU.

I've also added deny from all in .htaccess per domain to see if that would stop the high cpu. Didn't have any result.

The 100% CPU spikes happen every day at 11:45 till around 12:15. Very consistent every day. Mornings from like 9:00 to 9:15 as well.

What other options do I have to find out where this comes from?


Apache does not consume CPU for fun (well, some people may disagree about that :-). It does consume CPU to serve web requests.

So, if you see high CPU usage in Apache, there must be http requests to justify the load.

Try making histograms of web visits. For example, number of web requests in one-minute intervals, or in five-minute intervals.

At least one of your six domains should have a peak at the same time you see high CPU load.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct