top
top
使用
# 指定查看用户,键入数字 1 查看单个 CPU 的负载,P/M/T 分别切换按照 CPU、内存、CPU 占用时间排序
$ top -u oracle
# Cpu(s): 87.3%us, 1.2%sy, 0.0%ni, 27.6%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
us: user cpu time (or) % CPU time spent in user space
sy: system cpu time (or) % CPU time spent in kernel space
ni: user nice cpu time (or) % CPU time spent on low priority processes
id: idle cpu time (or) % CPU time spent idle
wa: io wait cpu time (or) % CPU time spent in wait (on disk)
hi: hardware irq (or) % CPU time spent servicing/handling hardware interrupts
si: software irq (or) % CPU time spent servicing/handling software interrupts
st: steal time - - % CPU time in involuntary wait by virtual cpu while hypervisor is servicing another processor (or) % CPU time stolen from a virtual machine
# 表格列
# PID:进程的ID
# USER:进程所有者
# PR:进程的优先级别,越小越优先被执行
# NInice:值
# VIRT:进程占用的虚拟内存
# RES:进程占用的物理内存
# SHR:进程使用的共享内存
# S:进程的状态。S表示休眠,R表示正在运行,Z表示僵死状态,N表示该进程优先值为负数
# %CPU:进程占用CPU的使用率
# %MEM:进程使用的物理内存和总内存的百分比
# TIME+:该进程启动后占用的总的CPU时间,即占用CPU使用时间的累加值。
# COMMAND:进程启动命令名称
第一行显示的内容:当前时间、系统运行时间以及正在登录用户数。
第三行的内容表示

此外,我们也可以使用扩展 htop 或者 glances;如果针对容器监控,可以使用 ctop。
➊ 在命令行输入
ps -eo %cpu,pid |sort -n -k1 -r | head -n 1 | awk ‘{print $2}’ |xargs top -b -n1 -Hp | grep COMMAND -A1 | tail -n 1 | awk ‘{print $1}’ | xargs printf 0x%x
找到使用
➊ 如果
除了关注类似