4

Assume you have a system with 2 processors. Now create a cgroup and configure this group to use only 1 processor. Populate it with enough processes to give it a load average of 5 (to prove a point); it is now hopelessly slow.

I am assuming that the load average in /proc/loadavg will then also be 5, even though a different user is free to use the other CPU with no wait time.

Is this correct? Is there a source I could quote for this?

Anthon
  • 78,313
  • 42
  • 165
  • 222
trevore
  • 149
  • 1
  • 3

1 Answers1

0

Your understanding is correct. This metric may give wrong impression that whole system is overloaded, while it may mean only specific cgroup is.

Load average is a system-wide measure of amount of running tasks (see also description of /proc/loadavg in man proc).

At the same time, man cgroups, for a cpu controller, says:

Cgroups can be guaranteed a minimum number of "CPU shares" when a system is busy. This does not limit a cgroup's CPU usage if the CPUs are not busy.

So if no other user is consuming CPU, that cgroup would take all. Otherwise, it will be limited to whatever limits set in cgroup (in your hypothetical example: 1 processor).

Kuchara
  • 113
  • 6