用 vmstat 一行命令看系统健康度

vmstat 每秒输出一行 CPU、内存、swap 换入换出和 I/O 等待数据,比 top 更直观地判断瓶颈类型。

Linuxvmstat 内存监控监控性能低风险
运行 `vmstat 2 5` 每 2 秒采样一次、共采样 5 次。

01命令

命令
$ vmstat 2 5

02作用说明

第一行是开机以来的平均值,应该忽略,重点看后面的行。si/so 数值高说明正在频繁换页(内存吃紧);wa 列高说明 CPU 空闲但在等磁盘 I/O。如果 us+sy 接近 100 且 wa 为 0,那就是 CPU 型负载。

03风险

风险低风险
使用条件procps installed (default on most distros)

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • vmstat(8) - Linux manual page
    Ubuntu Manpages · technical · 2026-09-17
    依据: vmstat reports virtual memory statistics; the interval and count arguments run it repeatedly, and columns include si/so swap activity and wa I/O wait.

最后验证: 2026-09-17 · 分类: 系统与设置

06相关方案