False (?) high cpu usage

jith45

Member
May 25, 2018
960
0
16
Hi there, guys..
I am not 100% sure but I believe that this problem started after I updated to ubuntu 12.04 from 11.10 (I am not even sure if this matters..)
In rutorrent I started seeing in the cpuload plugin abnormally high usage while there is nothing major running in the server
I thought I should look into this, but I realized that the cpu usage shown in rutorrent did not reflect the cpu usage shown using htop
I am posting an image.. As you can see, while htop reports 4% usage, the same time the plugin shows 24%.
Do you have any ideas about what might be the problem (and how to solve it)?
 

jith45

Member
May 25, 2018
960
0
16
Yes, I know...
the usage of the whole system at that specific time when i took the screenshot was 4% according to htop but cpu load plugin was reporting 24% - that's the problem I am asking about...
 

dsouvik215

Member
May 25, 2018
896
0
16
4% is the CPU usage OF htop.
You're system loads are at the top, these are averaged and your CPU cores take into account to display the %. Check cpu.php in /plugins/cpuload it's pretty apparent.
 

jith45

Member
May 25, 2018
960
0
16
AFAIK htop shows the most consuming processes at the top. That specific moment when I took the screenshot, htop was using 4%, but if you look below it, you will see that no other process is using the cpu.
Usually I see e.g. 5, below it 4, below it 3 etc.. So the cpu usage is 5+4+3=12% at that moment
The cpuload plugin, until recently was showing me cpu loads similar to the loads that htop, or top was showing me... Right now if I use
Code:
top -b -d 1|grep CpuI get
Code:
Cpu(s): 0.7%us, 0.3%sy, 0.0%ni, 97.6%id, 1.4%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 0.2%us, 0.0%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 0.0%us, 0.5%sy, 0.0%ni, 99.0%id, 0.5%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 1.7%us, 0.0%sy, 0.0%ni, 98.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 1.5%us, 2.0%sy, 0.0%ni, 96.6%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 2.5%us, 0.7%sy, 0.0%ni, 96.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 1.5%us, 0.2%sy, 0.0%ni, 98.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 1.7%us, 1.5%sy, 0.0%ni, 96.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni, 99.5%id, 0.5%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 2.0%us, 0.2%sy, 0.0%ni, 97.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 1.2%us, 1.7%sy, 0.0%ni, 97.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 0.2%us, 0.2%sy, 0.0%ni, 99.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 1.5%us, 0.2%sy, 0.0%ni, 98.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 1.2%us, 2.0%sy, 0.0%ni, 96.3%id, 0.5%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 1.5%us, 0.5%sy, 0.0%ni, 98.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 0.0%us, 0.5%sy, 0.0%ni, 99.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 1.0%us, 1.0%sy, 0.0%ni, 98.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu(s): 6.7%us, 1.0%sy, 0.0%ni, 92.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
At the same time cpuload plugin shows 22% cpuload

The bottom line is that I don't argue whether cpuload plugin calculates the averages or not (I strongly believe, though, that previously it was showing the current CPU usage almost in real time)
The problem is that those supposed averages are not the correct ones..
Any more ideas are highly appreciated!

P.S. : I take a look in cpu.php
I see it is using "grep -c processor /proc/cpuinfo". If I give the same command fron cli the return result is 4. cpuload plugin now shows 23..
PPS: In that machine I also have phpsysinfo installed. I am attaching what phpsysinfo reports. You can see the averages, plus the usage is at 1% when at the same time cpuload plugin shows 29%
 

jith45

Member
May 25, 2018
960
0
16
LOLlll, I assume you are referring to the
The plugin is purely for cosmetic use. It's pretty generalized in it's current state, and should not be taken as 100% accurate.​
part..
The reason I am asking is that it used to be accurate. And if not 100% accurate, while system usage was actually at 4% it would say e.g. 6%, not 30..
Oh, well, I'll forget about it... thanks anyway to both of you! wink.gif