Skip to content

Set reasonable total value for Load Meters#228

Closed
cgzones wants to merge 1 commit intohtop-dev:masterfrom
cgzones:load_total
Closed

Set reasonable total value for Load Meters#228
cgzones wants to merge 1 commit intohtop-dev:masterfrom
cgzones:load_total

Conversation

@cgzones
Copy link
Copy Markdown
Member

@cgzones cgzones commented Oct 8, 2020

Needed for graph and bar mode

Needed for graph and bar mode
@fasterit
Copy link
Copy Markdown
Member

fasterit commented Oct 9, 2020

Can you explain the rationale? Why 1.5?

@cgzones
Copy link
Copy Markdown
Member Author

cgzones commented Oct 9, 2020

Currently the total value for the LoadMeters is 100.
Thereby in MeterMode Graph there is (almost always) no data printed, cause the Load (in case of the LoadAverageMeter the accumulated 1+5+15 load) is far less than 100.
1.5 * is just a guess for a sensible maximum value, do you prefer 1.0 * or something higher?
(In case the actual load is higher than the guessed maximum, it is still displayed as 100%, since it's getting adjusted with MAXIMUM.)

@fasterit
Copy link
Copy Markdown
Member

fasterit commented Oct 9, 2020

I would have used 2 (two) as the initial maximum (as it will adjust upwards when real maxima are hit as you said). Load is a measure for the amount of processes & threads waiting in (uninterruptible) sleep (for resources). Hence it is not CPU (core) bound per se. You seem to use the common sense experience that lots of cores have lots to do but that may only be true on servers. I assume most desktop CPUs will be idling with a load around 1-2 typically. So using 2 as a common upper bound seems reasonable to me and on machines with real load it will quickly adjust upwards.

@BenBE
Copy link
Copy Markdown
Member

BenBE commented Oct 9, 2020

Typically when I look at the load value (numerically) I check if it's above about twice of the CPU count to check if the machine is overloaded. That's also when really compiling a lot of stuff what I usually give for the parallelism as you typically have some proceses waiting for I/O, others waiting for other resources.

So putting the load at 1CPUcount or 2CPUcount are two values you could easily compute in your head, being 1*CPUcount being "there's always some work for every core in the system" being a meaningful ground. Having the value statically at e.g. 1 or 2 would already drown the load meter in static noise on my desktop (currently idle at about 0.5); probably getting only worse on systems with many more cores. I think 1 would be a good value if we normalized by CPU count, as than it would roughly represent the amount of time the power of the CPU was used (by any process).

@Explorer09
Copy link
Copy Markdown
Contributor

Load average value is not supposed to have an upper limit. For bar display, it's better to have a limit that's dynamically scaled.
I remember I experimented the feature before. See #129 if you guys are interested to test.

@fasterit fasterit added the needs-discussion 🤔 Changes need to be discussed and require consent label Oct 20, 2020
@cgzones
Copy link
Copy Markdown
Member Author

cgzones commented Nov 20, 2020

Superseded by revamp of total values in #129

@cgzones cgzones closed this Nov 20, 2020
@cgzones cgzones deleted the load_total branch November 20, 2020 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-discussion 🤔 Changes need to be discussed and require consent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants