top 命令
示例
[root@os-gitlab-runner ~]# top
top - 16:59:38 up 1022 days, 7:02, 2 users, load average: 4.13, 3.21, 3.11
Tasks: 149 total, 1 running, 148 sleeping, 0 stopped, 0 zombie
%Cpu(s): 31.1 us, 4.5 sy, 0.0 ni, 49.7 id, 14.6 wa, 0.0 hi, 0.1 si, 0.0 st
KiB Mem : 8010424 total, 152468 free, 2697544 used, 5160412 buff/cache
KiB Swap: 8388604 total, 7276320 free, 1112284 used. 4944828 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
16078 root 20 0 67284 28984 3624 S 121.3 0.4 692391:54 gitlab-runner
4314 root 20 0 6621136 2.230g 3036 S 18.0 29.2 12813:26 dockerd
2737 root 10 -10 145744 17032 4292 S 3.7 0.2 102:26.52 AliYunDun
40 root 20 0 0 0 0 S 2.0 0.0 431:45.24 kswapd0
9 root 20 0 0 0 0 S 0.3 0.0 805:07.12 rcu_schedTasks相关参数
total 进程总数
running 正在运行的进程数
sleeping 睡眠的进程数
stopped 停止的进程数
zombie 僵尸进程数
CPU相关参数
31.1% us 用户空间占用CPU百分比
4.5% sy 内核空间占用CPU百分比
0.0% ni 用户进程空间内改变过优先级的进程占用CPU百分比
49.7% id 空闲CPU百分比
14.6% wa 等待输入输出的CPU时间百分比
0.0%hi:硬件CPU中断占用百分比
0.0%si:软中断占用百分比
0.0%st:虚拟机占用百分比
概括
us, user : time running un-niced user processes
sy, system : time running kernel processes
ni, nice : time running niced user processes
id, idle : time spent in the kernel idle handler
wa, IO-wait : time waiting for I/O completion
hi : time spent servicing hardware interrupts
si : time spent servicing software interrupts
st : time stolen from this vm by the hypervisor