Beruflich Dokumente
Kultur Dokumente
Mpstat is used to monitor cpu utilization on your system. It will be more useful if your system has multiple processors. The first processors
will signed as CPU 0. The second one will be signed CPU 1 and so on. From its manual page, mpstat is described as :
The mpstat command writes to standard output activities for each available processor, processor 0 being the first one. Global
average activities among all processors are also reported. The mpstat command can be used both on SMP and UP machines, but in
the latter, only global average activities will be printed. If no activity has been selected, then the default report is the CPU utilization
report
$ mpstat
03:29:29 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
03:29:29 PM all 6.30 0.06 1.94 3.75 0.00 0.06 0.00 0.00 87.88
If you found an error such as : command not found or similar you may not install mpstat in your system.
If you are using CentOS, RedHat or Fedora, run this command to install mpstat
If you are using Debian, Ubuntu or its derivative, run this command to install mpstat
# apt-get install sysstat
https://linoxide.com/linux-command/linux-mpstat-command/ 1/4
3/8/2019 Linux mpstat Command - Reports Processors Related Statistics
$ mpstat -P 0
03:54:00 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
03:54:00 PM 0 3.82 0.01 1.16 3.88 0.00 0.06 0.00 0.00 91.06
$ mpstat -P 1
Linux 3.2.0-57-generic (USERNB01) 12/12/2013 _x86_64_ (2 CPU)
03:53:58 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
03:53:58 PM 1 16.52 0.20 4.48 0.46 0.00 0.04 0.00 0.00 78.30
$ mpstat -P ALL
04:07:36 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
04:07:36 PM all 6.02 0.04 1.72 2.99 0.00 0.05 0.00 0.00 89.17
04:07:36 PM 0 3.84 0.01 1.15 3.72 0.00 0.06 0.00 0.00 91.21
04:07:36 PM 1 13.55 0.15 3.66 0.46 0.00 0.03 0.00 0.00 82.15
https://linoxide.com/linux-command/linux-mpstat-command/ 2/4
3/8/2019 Linux mpstat Command - Reports Processors Related Statistics
$ mpstat 3 4
04:27:11 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle
04:27:14 PM all 0.67 0.00 0.34 0.00 0.00 0.00 0.00 0.00 98.99
04:27:17 PM all 1.17 0.00 0.33 1.33 0.00 0.00 0.00 0.00 97.17
04:27:20 PM all 0.84 0.00 0.17 0.00 0.00 0.00 0.00 0.00 98.99
04:27:23 PM all 1.00 0.00 0.17 1.51 0.00 0.00 0.00 0.00 97.32
Average: all 0.92 0.00 0.25 0.71 0.00 0.00 0.00 0.00 98.12
The above command is to show you 4 reports about CPU utilization with 3 seconds intervals
$ mpstat -V
That's a quick usage of mpstat command in Linux system. You may see msptat manual page by typing man mpstat to explore more detail.
Comments
Your email address will not be published. Required fields are marked *
Name * Email *
Submit Your Comment
https://linoxide.com/linux-command/linux-mpstat-command/ 3/4
3/8/2019 Linux mpstat Command - Reports Processors Related Statistics
https://linoxide.com/linux-command/linux-mpstat-command/ 4/4