Linux using the mpstat command method

  
                

In Linux system operation, you need to use commands to monitor the CPU usage of Linux system in real time. There are many such commands (see How to use Linux commands to check CPU usage). The mpstat command is one of them. Kind, the following small series will introduce you to the Linux method of using the mpstat command.

What is mpstat

mpstat used to monitor the cpu utilization on your system. If your system has multiple processors, it will play a bigger role. The first processor will be marked as CPU 0. The second will be marked as CPU 2, and so on. In the operating manual, mpstat is described as follows:

The mpstat command writes the status of each available processor to standard output. The default first processor is processor 0. The global average status of all processors is also given in the form of a report. The mpstat command can be used on SMP and UP machines, but on UP machines, only the global average status will be printed. If no specific behavior is selected, the CPU utilization will be reported by default

How to run mpstat

Just type mpstat in your terminal to run mpstat.

$ mpstat< Br>

Linux 3.2.0-57-generic (USERNB01) 12/12/2013 _x86_64_ (2 CPU)

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 find that the command cannot be found or a similar error, you are May not have mpstat installed.

If you are using CentOS, RedHat or Fedora, run the following command to install mpstat

# yum install sysstat

If you are using Debian, Ubuntu or its Derived version, run the following command to install mpstat

# apt-get install sysstat
Previous12Next page Total 2 pages

Copyright © Windows knowledge All Rights Reserved