VMSTAT is the acronym for Virtual Memory Statistics, which monitors the operating system's virtualized memories, processes, and CPUs
Physical memory is the amount of memory provided by the system hardware, is the real memory, relative to the physical memory, under Linux there is a virtual memory concept, virtual memory is to meet the lack of physical memory of the proposed strategy, it is the use of disk space virtual out of a piece of logical memory, The disk space used as virtual memory is called swap space.
Example 1
vmstat 5 6procs -----------Memory---------- ---swap-- -----io---- --system-- -----CPU------ r b swpd free buff cache si so bi bo in cs us sy id wa st 0 0 0 3029876 199616 690980 0 0 0 2 3 2 0 0 100 0 0 0 0 0 3029752 199616 690980 0 0 0 41 1009 39 0 0 100 0 0 0 0 0 3029752 199616 690980 0 0 0 3 1004 36 0 0 100 0 0 0 0 0 3029752 199616 690980 0 0 0 4 1004 36 0 0 100 0 0 0 0 0 3029752 199616 690980 0 0 0 6 1003 33 0 0 100 0 0
Represents 5 seconds for 6 samples, where r represents the number of processes in progress, B represents the number of processes waiting for IO, swap represents the size of the virtual memory, free represents the available memory size, Buffe represents the size of the user-buffered memory, and the cache represents the memory size used for caching. Si represents the size of the swap area to memory per second and so represents the amount of memory written to the swap area per second. BI represents the number of blocks read per second, and Bo represents the number of blocks written per second. In represents the number of interrupts per second, CS represents the number of context switches per second, US represents the time the user executes the process, SY indicates the time the system process was executed, the ID represents the percentage of idle time, and WA indicates the time to wait for IO
The example 2-f indicates how many times the system has been forked now, which is obtained from the process field in the Process/stat
Vmstat-f
Example 3-s, which shows the details of using memory, is from/proc/meminfo,/proc/stat and/proc/vmstat respectively.
Vmstat-s
Example 4-d parameter indicates read and write of the view disk, data from/proc/diskstats
Vmstat-d
Example 5-p disk partitioning indicates viewing disk partition statistics
Vmstat-p/dev/sda1
The example 6-m parameter represents the slab information for viewing the system, and the information is from/proc/slabinfo
Vmstat-m
Slab: Because there are many small objects in the kernel, these object constructs are destroyed very often, such as i-node,dentry, these objects if each time the construction of the memory to a page (4KB), and actually only a few bytes, which is very wasteful, in order to solve this problem, A new mechanism is introduced to deal with how small stores are allocated in the same page box, and slab can allocate small objects so that there is no need to allocate a page box for each object, thus saving space, the kernel creates destructors for small objects very often, slab these small objects, and can be reused, Reduce the number of memory allocations.
Iostat is a disk-monitoring tool that can view activity information and payload information for CPUs, network cards, TTY devices, and disk devices
Example 1
iostatlinux 2.6.18-128.el5 (CT1186) 2012 December 28 avg-cpu: %user %nice %system %iowait %steal %idle 8.30 0.02 5.07 0.17 0.00 86.44Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtnsda 22.73 43.70 487.42 674035705 7517941952sda1 0.00 0.00 0.00 2658 536sda2 0.11 3.74 3.51 57721595 54202216sda3 0.98 0.61 17.51 9454172 270023368sda4 0.00 0.00 0.00 6 0sda5 6.95 0.12 108.73 1924834 1677123536sda6 2.20 0.18 31.22 2837260 481488056sda7 12.48 39.04 326.45 602094508 5035104240
%user:cpu the percentage of time in user mode.
%nice:cpu the percentage of time in user mode with nice value.
%system:cpu the percentage of time in system mode.
%iowait:cpu the percentage of time to wait for the input output to finish.
%steal: The percentage of the virtual CPU's unconscious wait time when the hypervisor maintains another virtualized processor.
%IDLE:CPU idle time percentage.
RQM/S: The number of read operations per second for the merge. namely RMERGE/S
WRQM/S: The number of write operations per second for the merge. namely WMERGE/S
R/S: Number of Read I/O devices completed per second. namely RIO/S
W/S: Number of write I/O devices completed per second. namely WIO/S
RSEC/S: Number of Read sectors per second. namely RSECT/S
WSEC/S: Number of Write sectors per second. namely WSECT/S
rkb/s: Reads K bytes per second. is half the rsect/s because the size of each sector is 512 bytes.
wkb/s: Writes K bytes per second. is half the wsect/s.
Avgrq-sz: The average data size (sector) per device I/O operation.
Avgqu-sz: Average I/O queue length.
Await: The average wait time (in milliseconds) for each device I/O operation.
SVCTM: The average service time (in milliseconds) per device I/O operation.
%util: How much time in a second is spent on I/O operations, which is the percentage of CPU consumed by IO
Example 2 means 2 seconds to refresh and 3 times to display
Iostat 2 3
Example-------show information about a specific disk
Iostat-d sda1
Example 4-t for displaying TTY and CPU information
Iostat-t
Example 5 showing TPS and throughput information
Iostat-d-K 1 1
Example 6 shows the device usage and the corresponding time
iostat-d-x-k 1 1
Example 7-C indicates CPU information is displayed
Iostat-c 1 1
Reference Documentation:
Http://www.cnblogs.com/peida/archive/2012/12/25/2833108.html
Http://www.cnblogs.com/peida/archive/2012/12/28/2837345.html
Linux Command--vmstat Command &iostat command