When I execute top
command on my ubuntu system I see below results
top – 07:58:58 up 1:21, 1 user, load average: 0.82, 0.73, 0.55
Tasks: 293 total, 1 running, 292 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.8 us, 0.8 sy, ….
I need to understand load average
and %cpu
.
My understanding based on my knowledge and high-cpu-utilization-but-low-load-average
Load Average
Load average is a measurement of how many tasks are waiting in a kernel run queue (not just CPU time but also disk activity) over a period of time.
Does it mean .83 tasks are waiting per above results ? How it can be decimal number ? Also what is three different figures 0.83 0.73, 0.55
?
%CPU
This represent the for how much time in last x seconds, CPU was working. For example :- if CPU utilization displays 60%, it means in last x seconds cpu was working 60% of time in x seconds.Is my understanding correct ? If yes what %Cpu(s): 0.8 us
represents ?
Also if I have 4 CPU processor, and %CPU displays 50% does it mean either all cores are working 50% or 2 CPU are working 100% ?
Best Answer
Load is the measure of the amount of computational work a system performs. The three values is the load average over a time interval. The intervals are, the last 1 minute, 5 minutes, and 15 minutes. Load average is computed as an exponential moving average. If you wish, you can take a deep dive and read Examining Load Average
Single Core System
0.83
means your CPU was at 83% capacity within the last minute. A value of1.0
would mean your CPU is at exact capacity (100%). With the value1.0
the system will be overloaded by adding even a little bit of additional work. A value greater than1.0
means it's getting more than it can handle. This isn't bad, it just means that more processes are waiting for CPU time. You would see the slowness of the computer.Multi-Core System
0.83
and having 4 cores, you would take0.83 / 4
to get0.2075
or(0.83 / 4) * 100
to get20.75%
capacity. With a quad-core system, if you had a load average greater than4.0
that would indicate all cores are at 100% capacity, and any overload will result in processes waiting for CPU time.Overloading occurs when you go over your max capacity. The load average as an overload can be a bit confusing to read because it's based on your cores. If you have a quad-core CPU, you won't overload until the load value is over
4.0
. If the first load average value was5.50
that would mean your system is 150% overloaded, and on average 1.5 processes in the last minute had to wait for CPU time.This section is a displays HOW the CPU has been used. Each suffix stands for something specific, and indicates how much time the CPU spent on that set of tasks. If you add up all of the numbers in that output row, it will add up to 100%.
The tasks are defined as... source