你这个问题有点简略,我按常见场景给你说明一下。
cpustat 在 CentOS 里通常不是系统自带命令,所以“怎么解决”一般有几种情况。
command not foundwhich cpustat
如果没输出,说明没装。
cpustatyum install -y epel-release
yum install -y cpustat
CentOS 7 / 8 都适用(CentOS 8 用
dnf)
sysstat(常见替代)很多用户其实只是想看 CPU 使用率,sysstat 更常用:
yum install -y sysstat
使用:
mpstat
mpstat -P ALL 1
top / htoptoptop
htop(更友好)yum install -y htop
htop
top
vmstat 1
iostat -x 1
mpstat -P ALL 1
查看:
%us:用户态%sy:内核态%wa:IO 等待%id:空闲cpustat有些教程里的 cpustat 其实是:
mpstatsarpcp)你可以直接告诉我:
我可以给你精确到命令级别的解决方案 ✅