在 Debian 上,cpustat 通常不是系统默认自带的命令,而是来自 sysstat 包(如 mpstat 类似)或 cpustat(由 Oracle 提供的性能工具,包名通常也叫 cpustat,命令为 cpustat)。下面分情况说明你能看到的指标。
cpustat(常见于 Debian 通过包安装或源码编译)cpustat 1 3
可能看到:
CPU usr sys idl wt stl intr/s csw/s
0 12 5 80 2 1 1200 3000
1 20 8 70 1 1 1100 2800
mpstat(sysstat 包,常被误称为 cpustat)常见指标:
%usr:用户态%nice:低优先级用户%sys:内核态%iowait:I/O 等待%irq:硬中断%soft:软中断%steal:虚拟化偷取%guest:虚拟机占用%idle:空闲示例:
mpstat -P ALL 1
# 安装
sudo apt install cpustat
# 每 1 秒刷新,共 5 次
cpustat 1 5
# 查看所有 CPU
cpustat -c all
在 Debian 上,cpustat 主要能看:
✅ CPU 使用率(用户 / 系统 / 空闲 / IO等待)
✅ 每个核心负载
✅ 中断和上下文切换
✅ 运行队列和调度情况
如果你愿意,可以告诉我:
我可以给你更精确的指标说明或对比。