Linux 进程“负载高”通常指 CPU 使用率高、系统负载(load average)高,或进程占用资源异常。原因可以分几个层次来看:
top / htop 中 %CPU 接近 100%uptime 中 load > CPU 核数✅ 排查:
top -H -p <pid>
perf top -p <pid>
✅ 排查:
iostat -x 1
iotop
✅ 排查:
free -h
vmstat 1
cat /proc/<pid>/status
表现:
D(不可中断睡眠)✅ 排查:
ps -eo pid,stat,comm | grep D
pstack <pid>
✅ 排查:
top # 看 si
cat /proc/interrupts
✅ 排查:
ps -ef | wc -l
pstree -p
# 1. 看整体
top
uptime
vmstat 1
# 2. 看哪个进程
top -c
# 3. 看线程
top -H -p <pid>
# 4. 看 I/O
iostat -x 1
iotop
# 5. 看调用栈
perf top -p <pid>
Linux 进程负载高 ≠ CPU 高
可能是:算得多、等 I/O、抢锁、换内存、中断多、进程多
如果你能贴出:
top / uptime 输出我可以直接帮你判断是哪一种原因。