Linux commands: Vmstat command-View Server resource summary information

Source: Internet
Author: User
Tags cpu usage

Vmstat command

Function description

The Vmstat command can display the CPU usage, memory usage, and virtual memory exchange of the server including the IO read and write situation. Use the following:

Vmstat [Options] [delay [count]]

Common parameters

Options Description
-A Show active and inactive memory
-F Displays the number of fork from system boot to current
-S Displays memory-related statistics and number of system activities
-N Show title only once at the beginning
Delay Refresh interval time, if not specified, displays only one result
Count Refresh number, not specified
-D Display disk-related statistics
-P Displays partition statistics for the specified disk
-S Display with specified units

Example

     refreshed every 2 seconds, displayed 2 times

[[email  protected] ~]# vmstat 2 2

procs-----------Memory-------------Swap-------io-----system--------CPU-----

 r  b   swpd   free   buff  cache   si   so &NB Sp  bi    BO   in   CS US sy ID WA st

 1  0   & nbsp  0 992824    764 724988    0    0     1     2   one   13 & Nbsp;0  0  0  0

 0  0      0 992808 & nbsp  764 724988    0    0     0     0    0    0-&NB Sp;0  0

Parameter description

Procs

The R column represents the number of processes running and waiting for CPU time slices, which, if longer than the number of system CPUs, indicates that the CPU is low and requires additional CPU

Column B indicates the number of processes waiting on the resource, such as waiting for I/O or memory exchange.

Memory

The SWPD column represents the mathematical (in kilobytes) of memory to the memory swap area. If the value of SWPD is not 0, or larger, as long as the value of Si, so long 0, in this case generally do not worry, it does not affect system performance.

The free column represents the amount of physical memory currently idle (in kilobytes).

The Buff column represents the amount of memory cached by the buffer, which is generally read and written to the block device.

The cache column represents the amount of memory in the page cache, generally as a file system cache, frequently accessed files are cached, if the cache value is large, the number of cached files, if at this time bi small in IO, the file system efficiency is better.

display disk information

[Email protected] ~]# vmstat-d

disk-------------reads------------------------writes----------------IO------

Total merged sectors Ms Total merged sectors Ms Cur sec

SDA 5614 676 1570107 89169 61439 20200 1149269 257890 0 142

Sr0 11 0 88 6 0 0 0 0 0 0

dm-0 5334 0 1512302 89926 81508 0 1145133 345551 0 141

Dm-1 222 0 1776 264 0 0 0 0 0 0

     Span style= "Padding:0px;margin:0px;color:rgb (192,0,0); font-family: ' Song body ', SimSun;" >

[Email protected] ~]# vmstat-p/dev/sda1

SDA1 reads read sectors writes requested writes

477 53957 136 4136

The information comes mainly from/proc/diskstats

reads: The number of reads from this partition.

Read sectors: The number of read sectors from this partition.

Writes: The number of writes from this partition.

Requested writes: Number of write requests from this partition.


Learn from:

Karst "Progressive Linux"

Http://www.cnblogs.com/MenAngel/p/5563180.html


This article is from the "Zhao Dongwei blog" blog, make sure to keep this source http://zhaodongwei.blog.51cto.com/4233742/1890291

Linux commands: Vmstat command-View Server resource summary information

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.