查看系统负载的时候,使用top命令
可以看到
%Cpu(s): 1.5 us, 0.3 sy, 0.0 ni, 98.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
10606 root 20 0 537224 88804 6920 S 11.0 0.5 16600:37 python
17868 root 10 -10 130980 17248 9824 S 1.3 0.1 171:00.22 AliYunDun
这边有两个参数%Cpu(s)
和%CPU
%Cpu(s)
us:us, user : time running un-niced user processes 用户空间占用CPU百分比
sy, system : time running kernel processes 内核空间占用CPU百分比
ni, nice : time running niced user processes 用户进程空间内改变过优先级的进程占用CPU百分比
wa, IO-wait : time waiting for I/O completion 等待输入输出的CPU时间百分比
hi : time spent servicing hardware interrupts 硬件中断
si : time spent servicing software interrupts 软件中断
st : time stolen from this vm by the hypervisor
%CPU
这个是进程占用的某个核心的百分比,理论上最大值可以达到核数*100%(多进程使用多核心的时候)