2

If I run top on the guest, the load average values seem to be exactly the same as running top on the host.

Is a Docker (LXC) guest's load average the same as the host's load average?

3

Looking at the code for /proc/loadavg - yes, it's the same. The load average is read out from global variables.

      seq_printf(m, "%lu.%02lu %lu.%02lu %lu.%02lu %ld/%d %d\n",
              LOAD_INT(avnrun[0]), LOAD_FRAC(avnrun[0]),
              LOAD_INT(avnrun[1]), LOAD_FRAC(avnrun[1]),
              LOAD_INT(avnrun[2]), LOAD_FRAC(avnrun[2]),
              nr_running(), nr_threads,
              task_active_pid_ns(current)->last_pid);

http://lxr.free-electrons.com/source/fs/proc/loadavg.c#L13

void get_avenrun(unsigned long *loads, unsigned long offset, int shift)
{
        loads[0] = (avenrun[0] + offset) << shift;
        loads[1] = (avenrun[1] + offset) << shift;
        loads[2] = (avenrun[2] + offset) << shift;
}

http://lxr.free-electrons.com/source/kernel/sched/proc.c#L79

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.