Sar-u 1 2
Iostat-c 1 2
Vmstat 1 2
Top
Uptime
Linux monitors CPU overall performance commonly used tools are:
# Mpstat:mpstat not only can view the average information of all CPUs, but also can view the information of the specified CPU.
# Vmstat: Can only view the average information of all CPUs; View CPU queue information;
# Iostat: Can only view average information for all CPUs.
# SAR: As with Mpstat, you can see not only the average CPU information, but also the information of the specified CPU.
# Top: The information displayed is close to PS, but top can understand the CPU consumption and can update the display according to the time specified by the user.
CPU Statistics Explained
%user percentage of CPU time used by the user process
%nice percentage of CPU time used by normal processes
Percentage of CPU time used by the%system kernel process
%iowait% of CPU time that I/O waits to occupy
%steal the percentage of time that the virtual CPU waits for a physical CPU
%idle Idle status percentage
1:mpstat
Mpstat is the abbreviation of multiprocessor statistics and is a real-time system monitoring tool. Some statistical information about its report and CPU, which is stored in the/proc/stat file. In a multi-CPUs system, it not only can view the average status information of all CPUs, but also can view the information of specific CPU. The following describes only Mpstat CPU-related parameters, Mpstat syntax is as follows:
Mpstat [-P {| All}] [internal [count]]
The meaning of the parameter is as follows:
Parameter interpretation
-P {| All} indicates which CPU is monitored and the CPU is valued in [0,cpu number-1]
Internal interval of two samples adjacent to each other
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.
2:vmstat-n 3 (Refresh once every 3 seconds)
3:iostat-c 1 2
#iostat-C 1 2
CPU statistics are displayed every 1 seconds
# iostat-d 2
The device statistics are displayed every 2 seconds.
Iostat
-C displays only CPU statistics. Mutually exclusive with the-D option.
-D displays only disk statistics. Mutually exclusive with-c option.
-K Displays the number of disk requests per second, in the default block of units, in units.
-P Device | All
Mutually exclusive with the-X option to display statistics for block devices and system partitions. You can also specify a device name after-p, such as:
# iostat-p HDA
or Show All devices
# iostat-p All
-T prints the time to collect data when outputting data.
-V Prints the version number and help information.
-X Output extension information.
Common tools for Linux detection CPU SAR iostat vmstat top uptime