温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

如何用CLI监控性能

发布时间:2026-09-02 10:31:02 来源:亿速云 阅读:87 作者:小樊 栏目:系统运维

下面按常见操作系统给你一个“用 CLI 监控性能”的实用清单,偏实战命令,不废话。


一、Linux(最常用)

1️⃣ 实时总览

top

或更现代:

htop

2️⃣ CPU

mpstat 1

sar -u 1

3️⃣ 内存

free -h

详细:

vmstat 1

4️⃣ 磁盘 I/O

iostat -x 1

dstat -d

5️⃣ 网络

iftop

sar -n DEV 1

6️⃣ 进程级

pidstat 1

7️⃣ 综合监控(推荐)

dstat -c -m -d -n 1

二、macOS

top -o cpu

内存:

vm_stat

磁盘:

iostat 1

网络:

nettop

三、Windows(CMD / PowerShell)

CMD

tasklist

PowerShell

Get-Process | Sort-Object CPU -Descending

性能计数:

typeperf "\Processor(_Total)\% Processor Time"

四、容器 / Kubernetes

Docker

docker stats

Kubernetes

kubectl top nodes
kubectl top pods

五、长期监控(CLI 方案)

  • sar(历史数据)
  • prometheus + node_exporter
  • glances(Web + CLI)

六、一句话建议

  • 临时排查htop + iostat
  • 性能分析sar
  • 服务器dstat
  • 容器docker stats / kubectl top

如果你愿意,可以告诉我: ✅ 系统(Linux / macOS / Windows)
✅ 场景(CPU 高?卡顿?网络慢?)
我可以直接给你针对性命令组合

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI