Introduction of the command

The mpstat (multi-processor Statistics) command is used to display Statistics on available cpus. Vmstat is a real-time monitoring tool that is similar to VMstat but only monitors the overall CPU performance.

[root@centos7 ~]# mpstat
-bash: mpstat: command not found
[root@centos7 ~]# yum install sysstat -y
Copy the code

Syntax format

mpstat [ options ]
Copy the code

Option to show

-p # Specifies the CPU numberCopy the code

Application, for example,

List the port

[root@centos7 ~]# mpstat Linux 3.10.0-1127.18.2.el7.x86_64 (centos7) 03/28/2021 _x86_64_ (1 CPU) 11:14:29am 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.79Copy the code

Fields that

%user # CPU time in user mode (%), not including the value of negative process (usr/total)*100 %nice # CPU time in user mode (%), not including the value of negative process (usr/total)*100 %nice # CPU time in user mode (%), The value of nice is negative CPU time (%)(nice/total)*100 %sys # Hard disk I/O wait time (%)(ioWAIT /total)* 100% irq # Soft interrupt time (%)(softirq/total)*100 % IDLE # In the internal time segment, the CPU is idle for any reason except waiting for disk I/O operations. Idle time (%)(idle/total)*100Copy the code

Learn a Linux command every day (108) : iptraf

Learn one Linux command per day (109) : iostat

Learn a Linux command every day (110) : ifstat