1

What does it mean for a core to run at different loads in different moments? How does a 10% load differ from a 90% load? How is this number calculated, essentially?

jcora
  • 3,884
  • 7
  • 36
  • 54

2 Answers2

3

It should be pretty obvious: time spent executing a task / total time.

So over a given interval, 10% load means 10% of that time was spent executing tasks, and 90% was idle.

psusi
  • 17,303
  • That is slightly inaccurate as the "load" can be superior to 100% in which case it becomes slightly less obvious – mveroone Jan 07 '14 at 15:21
  • @Kwaio, system load is something else, we're talking about cpu utilization, which can't be over 100%. – psusi Jan 07 '14 at 15:28
  • Hum. the use of the term "load" is then misleading. and in this case, the answer seems indeed pretty obvious. We may then just explain that the CPU maintains counters of time quantums spent in each state (iowait, running, idle, etc.) and the computation is a simple ratio of those counters over the total time. – mveroone Jan 07 '14 at 15:30
  • I didn't know a CPU had states ;_; Then yeah, this is completely obvious, it's weird how I didn't presume something like that. (In fact I did, I had a much more elaborate version of the question where I speculated what could be going on, one of my guesses was that Linux dynamically adjusts CPU frequency - which is kind of similar to load/idle except instead of being binary it's a scale). – jcora Jan 07 '14 at 15:33
  • Some CPU have frenquency scaling technologies, but that's still basic. For the "states" see http://unix.stackexchange.com/questions/18918/in-linux-top-command-what-are-us-sy-ni-id-wa-hi-si-and-st-for-cpu-usage?rq=1 For more information on linux' way to schedule the process : http://oreilly.com/catalog/linuxkernel/chapter/ch10.html – mveroone Jan 07 '14 at 15:53
  • @K7AAY, no, A cpu maxes out at 100%. If a tool adds two CPUs together to get 200%, then it is doing it wrong. top correctly shows 50% for a dual cpu system with one running at 100%. – psusi Jan 07 '14 at 18:15
2

As far as I know, the "load Average" is the average number of process requiring cpu execution time over 1/5/15mintes.

For example, say you have 1 CPU with 4 cores, any load superior to 4 means you don't have enough computing power to have all process running as fast as they wish.

mveroone
  • 937
  • 2
    The "load average" as reported by e.g. uptime is not measured in percent of anything. It is a unitless count of the number of runnable processes over a period of time. – user Jan 07 '14 at 15:32
  • So that's what load average means. Thanks. I was always too lazy to look it up, and I never needed that number... – jcora Jan 07 '14 at 15:36