-1

I was in assumption cpu average load is calculated depend on number of process in running state (R state) + process waiting for I/O ( D state). But today I noticed that server is showing high load average and number of running process is 1 and there is no process waiting for I/O.

I checked threads count also for running and I/O process that is minimum. Can someone give input from where this higher load average number is generating.

System is having 4 core cpu with ubuntu OS.

top - 21:10:01 up 4 days, 23:29,  0 users,  load average: 32.31, 43.25, 19.64
Threads: 2077 total,   1 running, 2076 sleeping,   0 stopped,   0 zombie
%Cpu(s):  4.9 us,  2.0 sy,  0.1 ni, 92.0 id,  0.6 wa,  0.4 hi,  0.0 si,  0.0 st
KiB Mem:  16434332 total, 15447756 used,   986576 free,  1593972 buffers

KiB Swap: 6287356 total, 1259140 used, 5028216 free. 2754608 cached Mem

so here I am here looking for exact formula to calculate system average load. Thanks in advance.

Sven
  • 98,649
  • 14
  • 180
  • 226
Sunil Bhoi
  • 189
  • 1
  • 2
  • 9

2 Answers2

2

Load is the number of current threards that are paused waiting on system calls.

Try running

ps -eafT

You might find that your single process can have dozens of threads.

The Load on a system is basically a measure of scheduling commitment at that time. You have number-of-cores available work to schedule out. If you have that many pids or threads fully saturating the scheduler, you will see number-of-cores load.

It's easy for your load average to spike much higher than that. Once you reach saturation, you are not performing as much "work" as may be being added, and you can have a "pile up" of tasks. The system has to chew its way through its backlog of syscalls before the loadavg can drop again.

  • Thanks Daryl, The top ouput I shared in question is with threads count only "Threads: 2077 total, 1 running 0 stopped". so still having confusion from where this higher load avg number is coming. – Sunil Bhoi Sep 28 '17 at 15:44
0

First, what is the problem, is there response time problems for the users?

Load average of 30 or 40 means many more than one process was running or I/O wait.

Your analysis is insufficient. Start with Linux Performance Analysis in 60,000 Milliseconds

Short version:

uptime
dmesg | tail
vmstat 1
mpstat -P ALL 1
pidstat 1
iostat -xz 1
free -m
sar -n DEV 1
sar -n TCP,ETCP 1
top
John Mahowald
  • 32,050
  • 2
  • 19
  • 34
  • Hey John thanks. Yes there is slowness on server. I will try to collect system other stats and will see if we got any other point to investigate it. – Sunil Bhoi Sep 28 '17 at 15:47