最近查一个性能问题,需要用到vmstat和iostat, 所以简单介绍下:
ubuntu@VM-0-15-ubuntu:~$ man vmstat
VMSTAT(8) System Administration VMSTAT(8)
NAME
vmstat - Report virtual memory statistics
SYNOPSIS
vmstat [options] [delay [count]]
DESCRIPTION
vmstat reports information about processes, memory, paging, block IO, traps, disks and cpu activity.
The first report produced gives averages since the last reboot. Additional reports give information on a sampling period
of length delay. The process and memory reports are instantaneous in either case.
ubuntu@VM-0-15-ubuntu:~$ man iostat
IOSTAT(1) Linux User's Manual IOSTAT(1)
NAME
iostat - Report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions.
SYNOPSIS
iostat [ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ] [ -j { ID | LABEL | PATH | UUID | ... }
] [ [ -H ] -g group_name ] [ -p [ device [,...] | ALL ] ] [ device [...] | ALL ] [ interval [ count ] ]
DESCRIPTION
The iostat command is used for monitoring system input/output device loading by observing the time the devices are active
in relation to their average transfer rates. The iostat command generates reports that can be used to change system con[m
figuration to better balance the input/output load between physical disks.
The first report generated by the iostat command provides statistics concerning the time since the system was booted,
unless the -y option is used (in this case, this first report is omitted). Each subsequent report covers the time since
the previous report. All statistics are reported each time the iostat command is run. The report consists of a CPU header
row followed by a row of CPU statistics. On multiprocessor systems, CPU statistics are calculated system-wide as averages
among all processors. A device header row is displayed followed by a line of statistics for each device that is config[m
ured.
在笔试面试中,也是重点,务必掌握。不要一问三不知。