Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 564 Bytes

cpu-usage.org

File metadata and controls

14 lines (10 loc) · 564 Bytes

cpu usage

load average 表示同一时间有多少任务等待 CPU 资源,而 cpu usage 表示 cpu 处理非空闲任务所花费的时间的百分比。

获取每个 CPU 使用情况:

cat /proc/stat |grep cpu |awk '{printf ("%5s usage %f\n", $1, 100-($5*100)/($2+$3+$4+$5+$6+$7+$8+$9+$10))}'

参考:Get Overall CPU Usage on Linux | Baeldung on Linux