System performance monitoring Tool-Mpstat

Source: Internet
Author: User

Mpstat (multiprocessor Statistics) is a real-time system monitoring tool. Reports some statistical information about the CPU, which is stored in the/proc/stat file. In a multi-CPUs system, you can see not only the average status information of all CPUs, but also the information of specific CPUs. Mpstat's biggest feature is the ability to view statistics for each compute core in a multi-core CPU, while a tool like Vmstat can only view the overall CPU of the system.

Mpstat [-P {| All}] [internal [count]]
Parameters:
-P {| All} indicates which CPU is monitored and the CPU is valued in [0,cpu number-1]
Internal the interval of two adjacent samples,
Count number of samples, count can only be used with delay
When there are no parameters, Mpstat displays the average of all information after the system starts. When there is interval, the first line of information is the average information since the system started. Starting with the second line, the output is the average information for the previous interval time period.

1) The command will output the current health information of the CPU every 2 seconds, output 5 times, if there is no second numeric parameter, Mpstat will be executed every two seconds until you press CTRL + C to exit.
Mpstat 2 5

Linux 2.6.32-71.el6.i686 (stephen-pc) 11/12/2011 _i686_ (1 CPU)
04:03:00 PM CPU%usr%nice%sys Iowait%IRQ%soft%steal%guest%idle
04:03:02 pm All 0.00 0.00 0.50 0.00 0.00 0.00 0.00 0.00 99.50
04:03:04 pm All 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
04:03:06 PM All 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
04:03: 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
04:03:10 PM All 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00
Average:all 0.00 0.00 0.10 0.00 0.00 0.00 0.00 0.00 99.90

The end of the first line gives the number of CPUs in the current system. The table below outputs the current CPU usage of the system, and the following is the meaning of each column:
%user in internal time period, the user State CPU time (%), does not contain the Nice value is negative process (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 internal time period, kernel time (%) (system/total) *100
%iowait in internal time period, HDD io wait time (%) (iowait/total) *100
%IRQ in internal time period, hard interrupt time (%) (irq/total) *100
%soft in internal time period, soft interrupt time (%) (softirq/total) *100
%idle in internal time period, the CPU is removed from waiting for the disk IO operation for any reason idle time idle time (%) (idle/total) *100

The calculation formula is as follows:
Total_cur=user+system+nice+idle+iowait+irq+softirq
total_pre=pre_user+ pre_system+ pre_nice+ pre_idle+ pre_iowait+ pre_irq+ PRE_SOFTIRQ
User=user_cur–user_pre
Total=total_cur-total_pre
Where _cur represents the current value, and _pre represents the value before interval time. All values in the table above are desirable to a two-bit decimal point.

2) If you want to see detailed current health information for each CPU core, the output is as follows:
Mpstat-p All 2 3
-p all means that data for all CPUs is printed, and the specified number of CPU data can be printed, such as-P 0 (CPU number 0 starts)

System performance monitoring Tool-Mpstat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.