Learn a Linux command every day (111): mpstat

Time:2021-9-15

Command introduction

The mpstat (multi processor Statistics) command is used to display the status statistics of each available CPU. It is a real-time monitoring tool, similar to vmstat, but can only monitor the overall performance status of the CPU.

[[email protected] ~]# mpstat
-bash: mpstat: command not found
[[email protected] ~]# yum install sysstat -y

Syntax format

mpstat [ options ]

Option description

-P # specifies the CPU number

Application examples

List ports

[[email protected] ~]# 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

Field description

%user      
#In the internal time period, the CPU time in user status (%), excluding processes with negative nice value (USR / total) * 100
%nice      
#In the internal time period, the nice value is the CPU time (%) of the negative process (nice / total) * 100
%sys       
#In the internal time period, the kernel time (%) (system / total) * 100
%iowait    
#In the internal time period, the hard disk IO wait time (%) (iowait / total) * 100
%irq         
#In the internal time period, hard interrupt time (%) (IRQ / total) * 100
%soft       
#In the internal time period, the soft interrupt time (%) (softirq / total) * 100
%idle       
#In the internal time period, the CPU is idle for any reason except waiting for disk IO operation. Idle time (%) (idle / total) * 100

Learn a Linux command every day (111): mpstat