Views:
280β
Votes: 3β
β
Solution
Tags:
gpu
conky
Link:
π See Original Answer on Ask Ubuntu β§ π
URL:
https://askubuntu.com/q/842214
Title:
CPU on Ubuntu running high
ID:
/2016/10/27/CPU-on-Ubuntu-running-high
Created:
October 27, 2016
Edited: June 12, 2020
Upload:
September 15, 2024
Layout: post
TOC:
false
Navigation: false
Copy to clipboard: false
When you are looking at the CPU% or Load factor you have to divide by the number of CPU Cores x Hyper Threading. So if you have a quad core processor with hyper threading itβs in interpreted as 8 CPUβs.
If your CPU% shows 200% and it is 8 CPUs then your real CPU usage is 25%.
If your load factor show β.92β and you have 8 CPUs then your real load factor is β.115β. In your Conky you would massage your load factor (for 5 minutes, 10 minutes and 15 minutes) by using:
${execpi .001 (awk '{printf "%s/", $1}' /proc/loadavg; grep -c processor /proc/cpuinfo;) | bc -l | cut -c1-4} ${execpi .001 (awk '{printf "%s/", $2}' /proc/loadavg; grep -c processor /proc/cpuinfo;) | bc -l | cut -c1-4} ${execpi .001 (awk '{printf "%s/", $3}' /proc/loadavg; grep -c processor /proc/cpuinfo;) | bc -l | cut -c1-4}
The Real CPU percentage can never go over 100% and the Real load factor can never go over 1 so you have to mentally do the math dividing by the number of CPUs or use Conky for accurate results instead of Top
or whatever program you were using.
Conky vs top
screen example
Comparing top
CPU% to Conkyβs CPU%:
Firefox is consuming the most CPU%. In top
it is listed at 27.8% in Conky it is listed at 3.37%. Taking Conkyβs percentage and multiplying by 8 (the number of CPUs) yields 27%.