Different load between rhel6 and rhel7

Latest response

Dear Red Hat,

I have run a little program on Rhel6 and Rhel 7.

Linux Rhel7 3.10.0-957.10.1.el7.x86_64 #1 SMP Thu Feb 7 07:12:53 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Linux Rhel6 2.6.32-754.9.1.el6.x86_64 #1 SMP Wed Nov 21 15:08:21 EST 2018 x86_64 x86_64 x86_64 GNU/Linux

#include <stdio.h>
#include <time.h>
int main(void)
        struct timespec tt;
        struct timespec tc;
        int a;
        int q;
        for (a=0; a<100; a++)
                q = fork();
                if (q == 0)
                        printf("%i\n", a);

        for (a=0; a<1000000; a++)

I have same results on both servers, but not load average.
server Rhel7
load average: 14,23, 8,30, 5,69
real 1m31.723s
user 0m1.544s
sys 0m10.330s
server Rhel6
load average: 0.01, 0.03, 0.00
real 1m35.845s
user 0m1.165s
sys 0m4.444s

Why load average are different when they do the same program?


Most likely you've discovered an accounting difference between kernel 2.6.32 and 3.10.

I've seen similar things happen between RHEL5's 2.6.18 and RHEL6's 2.6.32, they were also triggered by tiny syscalls like nanosleeps, especially if you fill them with incorrect parameters so the syscall fails.

It's good that RHEL7 is more accurate.

Just to input a more recent test here: 2.6 and 3.10 do really differ in their accounting of system load up to a certain point. It's likely that 2.6 doesn't account for actively running programs because they're not in the wait queue but 3.10 does account for those.

When running this test with 100 processes the accounting difference is really apparent between 2.6 and 3.10 but if you run it with 1000 of them, then the accounting difference is minuscule. It also seems like 4.18 will prioritize older processes to "get rid of them".

Tests were done on minimal installations of CentOS 6/7/8 to look for differences between their kernels.