Wednesday, January 6, 2016

Understanding load average in top command in linux




Taken from Redhat Case:

What is Load Average :- Linux follows the standard of traditional UNIX and computes its load average as the average number of runnable or running processes (dR state), and the number of processes in un-interruptable sleep (D state) over the specified interval. Some other operating systems calculate their load averages simply by looking at processes in R state. On those systems, load average is synonymous with the run queue -- high load averages mean that the box is CPU bound. This is not the case with Linux.

   On Linux the load average is a measurement of the amount of "work" being done by the machine (without being specific as to what that work is). This "work" could reflect a CPU intensive application (compiling a program or encrypting a file), or something I/O intensive (copying a file from disk to disk, or doing a database full table scan), or a combination of the two.

How do we determine whether Load average is High or Low ?
- I would like to explain this with an example, instead of putting in some description.

Eg:-
~~~~~
Consider a system is having 1 CPU
~~~~~
   If Load average in Top command is "Load average: 0.01, 0.05, 0.02" < This is very low load average

   If Load average in Top command is "Load average: 0.50, 0.50, 0.50" < This is moderate load average

   If Load average in Top command is "Load average: 0.75, 0.80, 0.70" < This is high load average and its time to check things

   If Load average in Top command is "Load average: 1.01, 1.05, 1.02" < This is high load average
and system surely is starving for CPU now

   If Load average in Top command is "Load average: 2.01, 2.05, 2.02" < This is very high load average and system may get hung at this point

~~~~~
So this was for a single CPU system. Now as per your system details I see it is running with 48 CPU's. So in your case
~~~~~
   If Load average in Top command is "Load average: 0.01, 0.05, 0.02" < This is obviously very low load average

   If Load average in Top command is "Load average: 5.01, 5.05, 5.02" < This is low load average, nothing to worry

   If Load average in Top command is "Load average: 24.01, 24.05, 24.02" < This is moderate load average

   If Load average in Top command is "Load average: 32.01, 35.05, 36.02" < This is high load average and its time to check things

   If Load average in Top command is "Load average: 48.01, 48.05, 48.02" < This is high load average and system surely is starving for CPU now

   If Load average in Top command is "Load average: 60.01, 70.05, 65.02" < This is very high load average and system may get hung at this point


If the load average is not greater than the total number CPU's it is within the danger mark. But if load average value is bigger than the total no of CPU's then system is soon going to face some issue or is already under some severe performance issue.

If (Load avg <= 20% N) This is low load average
If (Load avg is near 50% N) This is moderate load average
If (Load avg is near 70% N) This is high load average and its time to check things
If (Load avg is 100% N) This is high load average and system surely is starving for CPU now
If (Load avg greater than 120% N or) This is very high load average and system may get hung at this point

N = Total number of CPU's

You can find total number of CPU's on system in /proc/cpuinfo file or else while top command is running, press Number key "1" on keyboard, it will list details of all the CPU's.

No comments:

Post a Comment