Detailed linux command usage for monitoring CPU and virtual memory running information

Source: Internet
Author: User
Tags time interval

Mpstat

Mpstat is the abbreviation of multiprocessor statistics, a real-time system monitoring tool. Some statistical information about the report and CPU, which is stored in the/proc/stat file. In a CPUs system, it is not only possible to view the average information of all CPUs, but also to view information about a particular CPU. The biggest feature of Mpstat is the fact that you can view the statistics for each compute core in a multi core CPU, while a similar tool vmstat can only view the overall CPU of the system.

Grammar

Mpstat [-P {| All}] [internal [count]]

Parameters

-P {| All} indicates which CPU is being monitored, and the CPU is being evaluated in [0,CPU number 1]

Internal adjacent two sampling intervals,

Number of count 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 a 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. Mpstat is the abbreviation of multiprocessor statistics, a real-time system monitoring tool. Some statistical information about the report and CPU, which is stored in the/proc/stat file. In a CPUs system, it is not only possible to view the average information of all CPUs, but also to view information about a particular CPU. The biggest feature of Mpstat is the fact that you can view the statistics for each compute core in a multi core CPU, while a similar tool vmstat can only view the overall CPU of the system.

Grammar

Mpstat [-P {| All}] [internal [count]]

Parameters

-P {| All} indicates which CPU is being monitored, and the CPU is being evaluated in [0,CPU number 1]

Internal adjacent two sampling intervals,

Number of count 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 a 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.

Cases

The code is as follows:

# mpstat-p All 2 #查看多核CPU核心的当前运行状况信息, updated every 2 seconds

Field Letter Meaning:

%user in internal time period, User State CPU time (%), does not contain 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, hard disk 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 during the internal time period, the CPU removes idle time (%) for any reason outside the waiting disk IO operation (idle/total) *100

Vmstat

Vmstat Reports Virtual Memory statistics

Usage

Vmstat [-A] [-n] [-S] [delay [count]]

Vmstat [-S] [-n] [-s]

Vmstat [M] [-n] [delay [count]]

Vmstat [-d] [-n] [delay [count]]

Vmstat [-P disk partition] [-n] [delay [count]]

Vmstat [F]

Vmstat [-v]

Parameters

-A: Show active and inactive memory

-F: Displays the number of fork since the system started. Extended reading: http://www.cnblogs.com/leoo2sk/archive/2009/12/11/talk-about-fork-in-linux.html

-M: Show Slabinfo

-N: Displays the field names only once at the beginning.

-S: Displays memory-related statistics and a variety of system activity quantities.

Delay: Refresh time interval. If not specified, only one result is displayed.

Count: Number of refreshes. If you do not specify a refresh count, but the refresh interval is specified, the refresh count is infinite.

-D: Displays disk-related statistics.

-P: Display specified disk partition statistics

-S: Display with specified units. The parameters are K, K, M, and M, representing 1000, 1024, 1000000, 1048576 bytes (byte) respectively. The default unit is K (1024 bytes)

-V: Displays Vmstat version information.

Cases:

The code is as follows:

[Root@localhost ~]# Vmstat 2 #每二秒显示一次系统内存的统计信息


The code is as follows:

[Root@localhost ~]# vmstat 2 5 #每二秒显示一次系统内存的统计信息, total 5 times


The code is as follows:

[Root@localhost ~]# vmstat-d #显示磁盘信息

Related Article

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.