-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent CPU when compared to htop #17
Comments
Yah, gotop divides the CPU usage by the number of cores to show overall CPU usage which differs from the way htop/top works. I hadn't noticed that descrepency before so thanks for pointing that out. Is one way better than the other? If people want per-core CPU usage then maybe we could add a cli option to allow choosing between the two. |
afaik, it's common that cores go to 100%, CPU goes to 100%*nr of cores. So a process using 150% CPU in a quad-core will, in fact, be using one core at 100% and another at 50% - or any other combination of it. Good reference: https://unix.stackexchange.com/questions/145247/understanding-cpu-while-running-top-command |
It is common and it's used by top/htop, but other resource monitors use gotop's method too like ksysguard. I think it's mostly preference. I personally prefer displaying overall % CPU and I think the default should stay that way, but if we want to add an option or keybind to switch between the two then that sounds good to me! |
I'd really like to have an option to switch between both ways of showing CPU usage. |
It seems to me there is more discrepancy than can be explained by the above reason. I have a VMBox with windows inside running on OSX. gotop showed me max 10% on the VirtualBoxVM provess (mostly around 5%). That would be approx 1 core on my 12 core machine. htop easily goes up to 300-500% (3-5 cores). Any idea what that could be? Very nice tool none the less! I love it! |
@tehsphinx So assuming htop is correctly reporting that information, that discrepancy sounds like a gotop bug and must have something to do with the way we're gather CPU usage information. I'm not immediately sure what that could be, since we're just running |
@cjbassi Since this is currently hard to compare (because of the different measuring mentioned in this issue) I'm going wait for the suggested option. Keeping an eye out in the meantime. |
@suroa FYI |
I see two topics in this ticket.
I'm not interested in displaying paradoxical values > 100%. Not only is it a very silly thing, to know how much CPU is really being used, the user still has to do mental math to know what the max value is. Therefore, given:
Then: 2.1 - ∑C/Δt (actually, it should be a rolling average over a time window, so slightly more complex than that) So: I'm short-cutting this ticket to the first issue; are the CPU usages reported by gotop correct? The other one, I'll create a feature request for. |
Required information:
gotop -v
: 2.0.0uname -a
: Linux rpi 4.14.92-1-ARCH Add ability to send different signals to processes #1 SMP Thu Jan 10 04:52:45 UTC 2019 armv7l GNU/LinuxI've seen inconsistent CPU usage from gotop and htop. For the gotop process, CPU usage ranges from 7 to 15% continuously on htop, but gotop reports around 3%, continuously.
I would guess this is because htop shows the total CPU usage in all CPUs and gotop is showing the CPU usage divided by the number of cores. Is this correct? Is this the intended behavior? Or should it follow htop style and go to 400% in a 4 core CPU?
The text was updated successfully, but these errors were encountered: