2

I have a Debian 7 x64 machine running with Digital Ocean that has every 30 Minutes a 100% cpu usage for about 1 minute. A couple of days ago it stayed there for a couple of hours so the server finally crashed and I had to repair my Mysql databases. The server is a pure webserver running apache2 and Mysql.

I tried tracing which processes use the cpu but with no luck. The script I used:

#!/bin/sh

while true; do ps -A -eo pcpu,pid,user,args | sort -k 1 -r | head -3 >>
proclog.txt; echo "\n" >> proclog.txt; sleep 2; done

I was monitoring htop as well while this was happening, but the top processess' cpu usage didn't add up to ~15% even though htop's cpu meter showed constant 100%. htop was configured to show all users' processess, user- and kernel-threads.

Edit: By stopping Apache2 & Mysql prior to the expected 100% usage I can tell both are not responsible for it. The 100% usage occurred anyway.

This is what the graph looked like the past hours: some graphs

user654123
  • 121
  • 2
  • ok, but even if your processes take upto ~15% and even low, some of them can easily cause loops to death. what is your top 10 processes and %sy at that time. – ADM Jun 01 '14 at 09:25
  • I'd like to comment that with a picture I took after ~1 minute of this high usage (it ended shortly after it): http://s29.postimg.org/efz20tl3b/Untitled.png I am starting to think another machine on this host is causing this, can it be? – user654123 Jun 01 '14 at 09:43

1 Answers1

0

I suppose you machine is a VM?

Then, you might see these peaks due to the hardware's resources where your machine is running on.

I guess that it is a syswait or iowait type of peak, where your machine has to wait for the virtualization host to complete its task(s). In this case, you won't see a thing in htop/atop/... since you machine is actually not doing a thing.

Since this is happening on such a regular basis, I would suggest some kind of cron-job that is doing a lot of IO on the host where your machine is running.

Maybe you install/use atop, which also logs system statistics for later analysis. Good luck.

der_do
  • 101
  • 5