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?

  • It seems this is a bug, isn't it? – Roboz Béla Apr 8 at 9:39

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,


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;


| improve this answer | |

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.