The system load average is specified by commands such as w, top and uptime.
The load average is a measure of number of processes that are either in the TASK_RUNNABLE state or in TASK_UNINTERRUPTIBLE state.
TASK_RUNNABLE processes are in run queue and may or may not currently have the CPU.
TASK_UNINTERRUPTIBLE processes are waiting for IO.
The load averages are time-dependant averages and taken over a period of 1,5 and 15 minutes. The sar utility can be used to obtain the 1 and 5 minutes values for the system load average.
To find the number of processes in TASK_RUNNABLE state
$ grep "procs_running" /proc/stat
procs_running 11
$ vmstat 2
Check the first column "r". This gives the number of processes in the "TASK_RUNNABLE" state.
To find the number of processes in TASK_UNINTERRUPTIBLE state
$ grep "procs_blocked" /proc/stat
procs_blocked 1
$ vmstat 2
Check the second column "b". This gives the number of processes in the blocked state or TASK_UNINTERRUPTIBLE state.
No comments:
Post a Comment