命令简介
mpstat(Multi-Processor Statistics) 命令用于显示各个可用CPU的状态统计。是一个实时监控工具,与vmstat相似,但只能监控CPU的整体性能状态。
[root@centos7 ~]# mpstat -bash: mpstat: command not found [root@centos7 ~]# yum install sysstat -y
语法格局
mpstat [ options ]
选项阐明
-P #指定CPU编号
利用举例
列出端口
[root@centos7 ~]# mpstat Linux 3.10.0-1127.18.2.el7.x86_64 (centos7) 03/28/2021 _x86_64_ (1 CPU) 11:14:29 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle 11:14:29 AM all 1.61 0.00 0.48 0.05 0.00 0.07 0.00 0.00 0.00 97.79
字段阐明
%user #在internal时间段里,用户态的CPU工夫(%),不蕴含nice值为负过程 (usr/total)*100 %nice #在internal时间段里,nice值为负过程的CPU工夫(%)(nice/total)*100 %sys #在internal时间段里,内核工夫(%)(system/total)*100 %iowait #在internal时间段里,硬盘IO等待时间(%) (iowait/total)*100 %irq #在internal时间段里,硬中断工夫(%)(irq/total)*100 %soft #在internal时间段里,软中断工夫(%)(softirq/total)*100 %idle #在internal时间段里,CPU除去期待磁盘IO操作外的因为任何起因而闲暇的工夫闲置工夫(%) (idle/total)*100