---
title: Linux 性能分析:top、vmstat、iostat 与 perf 实战
keywords:
- top
- vmstat
- iostat
- pidstat
- perf
description: 系统与进程层面的性能分析命令与思路,提供可直接复制的示例与观察要点。
categories:
- 文章资讯
- 技术教程
---
Linux 性能分析:top、vmstat、iostat 与 perf 实战
快速体检
top -H -p <pid>
vmstat 1 5
iostat -x 1 5
pidstat -d 1 5
网络与系统
sar -n DEV 1 5
ss -tna | head
CPU 热点
perf top
perf record -F 99 -p <pid> -- sleep 30 && perf report
观察要点
- CPU/负载、上下文切换与软中断
- 磁盘队列与等待、读写延迟
- 网络吞吐与错误包
总结
通过分层采样与指标观察,可快速定位系统瓶颈并指导优化方向。

发表评论 取消回复