Linux上的负载平均值(/proc/loadavg
,也可以通过uptime
和top
等命令报告)是CPU和磁盘负载的度量:
来自man 5 proc
:
/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 sepa-
rated by a slash (/). The first of these is the number of cur-
rently 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.
我真的很想找到只针对CPU负载的平均负载指标(运行队列中作业数(状态R),不包括等待磁盘I/O的作业(状态D)。是否有人知道我能否获得这个指标?