What Do the Numbers in /Proc/Loadavg Mean on Linux

What do the numbers in /proc/loadavg mean on Linux?

/proc/loadavg

The first three fields in this file are load average figures giving
the number of jobs in the run queue (state R) or waiting for disk
I/O (state D) averaged over 1, 5, and 15 minutes. They are the
same as the load average numbers given by uptime(1) and other
programs.

The fourth field consists of two numbers separated by a
slash (/). The first of these is the number of currently executing
kernel scheduling entities (processes, threads); this will be less
than or equal to the number of CPUs. The value after the slash is the
number of kernel scheduling entities that currently exist on the
system.

The fifth field is the PID of the process that was most
recently created on the system.

Fifth column of /proc/loadavg?

The last value is the pid of the currently active process (while showing the contents of /proc/loadavg) which is likely a cat process

cat /proc/loadavg

which has already terminated while you are reading the results on screen.


Update:

I played around with it to prove that it is indeed the cat process. I simply used less, kept it open and tried to investigate the proc file system. I can only say the pid shown in loadavg was not the PID of less which I thought. Still true is what I said: the process listed there is current active process and it has been terminated already. But it seems not the PID of the cat process.

Get load at a moment in time or getloadavg() for a smaller time period in Python in Linux (CentOS)

According to Documentation/filesystems/proc.txt in the Linux 3.5 kernel source, you can retrieve the number of currently running processes from /proc/stat:

>>> for l in open("/proc/stat"):
... l = l.split()
... if l[0] == 'procs_running':
... result = int(l[1])
...
>>> print result
6
>>>

The same number is available in /proc/loadavg:

>>> print int(open("/proc/loadavg").next().split()[3].split('/')[0])
6

Command to get only the load average Linux

I just googled and found this.

Hope this helps :

http://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html

I think this command will solves your question.

cat /proc/loadavg



Related Topics



Leave a reply



Submit