0

I am trying to understand the load average on my system when idle. Here are some results after the system has been running for a few hours, with almost nothing installed.

vmstat

root@arm:~# vmstat 1
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 0  0      0  62092  17860 135940    0    0     9    21  158  245  1  1 97  0
 0  0      0  62092  17860 135940    0    0     0     0  105  137  0  0 100  0
 0  0      0  62060  17860 135940    0    0     0     0  105  128  0  0 100  0
 0  0      0  62060  17860 135940    0    0     0     0  105  174  0  0 100  0
 0  0      0  62060  17860 135940    0    0     0     0  105  155  0  0 100  0
 0  0      0  62092  17860 135940    0    0     0     0  105  134  0  0 100  0
 0  0      0  62092  17860 135940    0    0     0     0  105  127  0  0 100  0
 0  0      0  62092  17860 135940    0    0     0     0  106  133  0  0 100  0
 0  0      0  62092  17860 135940    0    0     0     0  105  129  0  0 100  0
 0  0      0  62092  17868 135940    0    0     0    52 2101 4081  0  4 95  1
 0  0      0  62092  17868 135940    0    0     0     0  103  173  0  0 100  0
 0  0      0  62060  17868 135940    0    0     0     0  103  129  0  0 100  0

mpstat

root@arm:~# mpstat 1
Linux 3.10.0 (arm)  03/25/15    _armv7l_    (1 CPU)

20:02:04     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
20:02:05     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
20:02:06     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
20:02:07     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
20:02:08     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
20:02:09     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
20:02:10     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
20:02:11     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
20:02:12     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
20:02:13     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
20:02:14     all    0.00    0.00    0.00    0.00    0.00    0.99    0.00    0.00   99.01
20:02:15     all    0.00    0.00    0.00    0.00    0.00    0.99    0.00    0.00   99.01
20:02:16     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00

sar

root@arm:~# sar
Linux 3.10.0 (arm)  03/25/15    _armv7l_    (1 CPU)

17:53:42          LINUX RESTART

17:54:01        CPU     %user     %nice   %system   %iowait    %steal     %idle
17:55:01        all      0.25      0.00      0.63      0.00      0.00     99.12
17:56:01        all      0.07      0.00      0.47      0.00      0.00     99.47
17:57:01        all      0.25      0.00      0.43      0.02      0.00     99.30
17:58:01        all      0.20      0.00      0.47      0.03      0.00     99.30
17:59:02        all      0.13      0.00      0.30      0.03      0.00     99.53
18:00:01        all      0.08      0.00      0.36      0.02      0.00     99.54
18:01:01        all      0.12      0.00      0.45      0.02      0.00     99.4

All three utliities have similar results. Now for top..

top

top - 19:50:39 up  2:47,  1 user,  load average: 0.81, 0.77, 0.77
Tasks:  50 total,   1 running,  49 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1.4 us,  0.8 sy,  0.0 ni, 97.3 id,  0.4 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem:    251692 total,   189540 used,    62152 free,    17724 buffers
KiB Swap:        0 total,        0 used,        0 free,   135920 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                               
 5249 root      20   0  3100 1176  864 R  10.7  0.5   0:00.07 top                                   
    1 root      20   0  2104  708  612 S   0.0  0.3   0:01.16 init                                  
    2 root      20   0     0    0    0 S   0.0  0.0   0:00.01 kthreadd                              
    3 root      20   0     0    0    0 S   0.0  0.0   0:00.05 ksoftirqd/0                           
    5 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kworker/0:0H                          
    6 root      20   0     0    0    0 S   0.0  0.0   0:00.25 kworker/u2:0                          
    7 root      20   0     0    0    0 S   0.0  0.0   0:00.01 rcu_preempt                           
    8 root      20   0     0    0    0 S   0.0  0.0   0:00.00 rcu_bh                                
    9 root      20   0     0    0    0 S   0.0  0.0   0:00.00 rcu_sched                             
   10 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 khelper                               
   11 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kdevtmpfs                             
  202 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 writeback                             
  204 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 bioset                                
  206 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kblockd                               
  235 root      20   0     0    0    0 S   0.0  0.0   0:00.00 khubd      

Notice that the load average is [0.81, 0.77, 0.77]!

Any idea to what's going on to cause such high "load average"?

EDIT: This question isn't about what load average is.

"load average figures giving the number of jobs in the run queue (state R) or waiting for disk I/O (state D)"

How can there be state D processes if i/o is almost zero, and how are there so many jobs in the run queue? Is there a way to tell which jobs are on there?

  • how many CPUs (cores) do you have? – Milind Dumbare Mar 25 '15 at 20:54
  • Single core armv7. Surprisingly, on an older armv6 processor, the load average is 0.05 – user791953 Mar 26 '15 at 12:57
2

load average is a relative term; it's possible to have 0.01, 3.00, 14.00 - it's merely an indicator how much work is backed up, which is a function of how many cores you have available. On a 4 core system, 3.9 means nothing is backed up (but almost...).

Looking at your output from top, I see that you're using 10.7% of your CPU just for top. I'm going to guess, but you have a lower end core. In that case, the averages would be easy to get up into the 0.8 range.

It's important to note that load average is NOT directly commensurate with your CPU's non-idle %, but more so how much work is passing through, and what level the contention is at (if any).

Here is a more exhaustive answer for the intricacies of how the loadavg is actually calculated: https://stackoverflow.com/questions/11987495/linux-proc-loadavg

  • The 10% is just when I turn it on briefly, it goes down to almost nothing. Also, I understand that CPU != load average. How can I tell which jobs are in the run queue? – user791953 Mar 26 '15 at 13:55
  • I would guess ps r -A ? – thinice Mar 26 '15 at 21:17
0

Assuming perf works on your system (it just falls over on my old laptop), you can get more fine-grained CPU accounting, which shows % of the total, i.e. ignores all your idle time so you'll get nice big percentages:

perf top --sort=comm

I guess it doesn't really help as if it's more IO-related, though it will at least highlight the top tasks which are actually waking up, and not just sleeping all the time.

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.