VMSTAT(8) Linux Administrator’s Manual VMSTAT(8)
名前
vmstat - 仮想メモリの統計を報告する
書式
vmstat [-a] [-n] [-S unit] [delay [ count]]
vmstat [-s] [-n] [-S unit]
vmstat [-m] [-n] [delay [ count]]
vmstat [-d] [-n] [delay [ count]]
vmstat [-p disk partition] [-n] [delay [ count]]
vmstat [-f]
vmstat [-V]
説明
vmstat はプロセス・メモリ・ページング・ブロック IO・トラップ・CPU 稼働
状況などに関する情報を報告する。
最初に作成される報告では、最後に再起動して以降の平均が与えられる。そ れ
以降の報告では、長さ delay のサンプリング期間に関する情報が与えられる。
プロセスとメモリに関する報告は、いずれも報告の瞬間のものである。
オプション
-a 2.5.41 以降のカーネルで指定すると、アクティブ/非アクティブな メ
モリの表示する。
-f ブート後の fork 数を表示する。これには fork, vfork, clone システ
ムコールが含まれ、生成されたタスク数と等しい。各プロセスは、スレ
ッドの使用数によって、1 つ以上のタスクで表現される。これは繰り返
し表示されない。
-m slabinfo を表示する。
-n ヘッダの表示が一度だけになる。デフォルトでは、一定の周期でヘッダ
が繰り返し表示される。
-s 種々のイベントカウンタとメモリの統計の表を表示する。この表示は繰
り返し表示されない。
delay 更新の間隔。単位は秒。 delay が指定されなければ、最後の起動以 降
の平均値が 1 回だけ報告される。
count 更新の回数。 count が指定されず、 delay が指定されている場合は、
count のデフォルトは無限回になる。
-d ディスクの統計を表示する (2.5.70 以降が必要)。
-p このオプションの後に指定したパーティション名に関する詳細な統計を
表示する (2.5.70 以降が必要)。
-S こ のオプションの後に k, K, m, M を付けると、出力を 1000, 1024,
1000000, 1048576 バイト単位に切り替える。
-V バージョン情報を表示する。
VM モードにおけるフィールドの説明
Procs
r: ランタイム待ちのプロセス数
b: 割り込み不可能なスリープ状態にあるプロセス数
Memory
swpd: 仮想メモリの量。
free: 空きメモリの量。
buff: バッファに用いられているメモリの量。
cache: キャッシュに用いられているメモリの量。
inact: アクティブでないメモリの量 (-a オプション)。
active: アクティブなメモリの量 (-a オプション)。
Swap
si: ディスクからスワップインされているメモリの量 (/s)。
so: ディスクにスワップしているメモリの量 (/s)。
IO
bi: ブロックデバイスから受け取ったブロック (blocks/s)。
bo: ブロックデバイスに送られたブロック (blocks/s)。
System
in: 一秒あたりの割り込み回数。クロック割り込みも含む。
cs: 一秒あたりのコンテキストスイッチの回数。
CPU
これらは CPU の総時間に対するパーセンテージである。
us: カーネルコード以外の実行に使用した時間 (ユーザー時間、nice 時間を含む)。
sy: カーネルコードの実行に使用した時間 (システム時間)。
id: アイドル時間。Linux 2.5.41 以前では、IO 待ち時間を含んでいる。
wa: IO 待ち時間。Linux 2.5.41 以前では、0 と表示される。
st: 仮想マシンから盗まれた時間。Linux 2.6.11より前では未知。
ディスクモードにおけるフィールドの説明
Reads
total: 成功した読み込みの総数
merged: グループ化された (結果として 1 つの I/O となった) 読み込みの数
sectors: 読み込みに成功したセクタ数
ms: 読み込みに使用した時間 (ミリ秒)
Writes
total: 成功した書き出しの総数
merged: グループ化された (結果として 1 つの I/O となった) 書き出しの数
sectors: 書き出しに成功したセクタ数
ms: 書き出しに使用した時間 (ミリ秒)
IO
cur: 実行中の I/O
s: I/O に使用した時間 (秒)
ディスクパーティションモードにおけるフィールドの説明
reads: このパーティションに発行された読み込みの総数
read sectors: このパーティションから読み込まれた総セクタ数
writes : このパーティションに発行された書き出しの総数
requested writes: このパーティションへの書き出し要求の総数
SLAB モードにおけるフィールドの説明
cache: キャッシュ名
num: 現在アクティブなオブジェクトの数
total: 利用可能なオブジェクトの総数
size: 各オブジェクトのサイズ
pages: 少なくとも 1 つのアクティブなオブジェクトがあるページの数
totpages: 確保 (allocate) された総ページ数
pslab: slab 当りのページ数
注意
vmstat には特別な権限は必要ない。
これらの報告は、システムのボトルネックを突き止める作業の手助けをする も
のである。 Linux の vmstat は、自分自身は実行プロセスとしての勘定に入れ
ない。
Linux のブロックは、今のところ全て 1024 バイトである。古いカーネルは ブ
ロックが 512・2048・4096 バイトであると表示するかもしれない。
procps 3.1.9 以降では、vmstat はデフォルトモードにおいて単位 (k, K, m,
M) をユーザーに選択させる。デフォルトは K (1024 バイト) である。
vmstat は slabinfo 1.1 を使用する。間違えていたら修正して欲しい。
ファイル
/proc/meminfo
/proc/stat
/proc/*/stat
関連項目
iostat(1), sar(1), mpstat(1), ps(1), top(1), free(1)
バグ
デバイスごとのブロック io を表にしない。またシステムコールの回数を数 え
ない。
著者
Henry Ware
VMSTAT(8) Linux Administrator’s Manual VMSTAT(8)
NAME
vmstat - Report virtual memory statistics
SYNOPSIS
vmstat [-a] [-n] [-t] [-S unit] [delay [ count]]
vmstat [-s] [-n] [-S unit]
vmstat [-m] [-n] [delay [ count]]
vmstat [-d] [-n] [delay [ count]]
vmstat [-p disk partition] [-n] [delay [ count]]
vmstat [-f]
vmstat [-V]
DESCRIPTION
vmstat reports information about processes, memory, paging, block IO,
traps, and cpu activity.
The first report produced gives averages since the last reboot. Addi-
tional reports give information on a sampling period of length delay.
The process and memory reports are instantaneous in either case.
Options
The -a switch displays active/inactive memory, given a 2.5.41 kernel or
better.
The -f switch displays the number of forks since boot. This includes
the fork, vfork, and clone system calls, and is equivalent to the total
number of tasks created. Each process is represented by one or more
tasks, depending on thread usage. This display does not repeat.
The -t switch adds timestamp to the output.
The -m switch displays slabinfo.
The -n switch causes the header to be displayed only once rather than
periodically.
The -s switch displays a table of various event counters and memory
statistics. This display does not repeat.
delay is the delay between updates in seconds. If no delay is speci-
fied, only one report is printed with the average values since boot.
count is the number of updates. If no count is specified and delay is
defined, count defaults to infinity.
The -d reports disk statistics (2.5.70 or above required)
The -w enlarges field width for big memory sizes
The -p followed by some partition name for detailed statistics (2.5.70
or above required)
The -S followed by k or K or m or M switches outputs between 1000,
1024, 1000000, or 1048576 bytes
The -V switch results in displaying version information.
FIELD DESCRIPTION FOR VM MODE
Procs
r: The number of processes waiting for run time.
b: The number of processes in uninterruptible sleep.
Memory
swpd: the amount of virtual memory used.
free: the amount of idle memory.
buff: the amount of memory used as buffers.
cache: the amount of memory used as cache.
inact: the amount of inactive memory. (-a option)
active: the amount of active memory. (-a option)
Swap
si: Amount of memory swapped in from disk (/s).
so: Amount of memory swapped to disk (/s).
IO
bi: Blocks received from a block device (blocks/s).
bo: Blocks sent to a block device (blocks/s).
System
in: The number of interrupts per second, including the clock.
cs: The number of context switches per second.
CPU
These are percentages of total CPU time.
us: Time spent running non-kernel code. (user time, including nice time)
sy: Time spent running kernel code. (system time)
id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle.
st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown.
FIELD DESCRIPTION FOR DISK MODE
Reads
total: Total reads completed successfully
merged: grouped reads (resulting in one I/O)
sectors: Sectors read successfully
ms: milliseconds spent reading
Writes
total: Total writes completed successfully
merged: grouped writes (resulting in one I/O)
sectors: Sectors written successfully
ms: milliseconds spent writing
IO
cur: I/O in progress
s: seconds spent for I/O
FIELD DESCRIPTION FOR DISK PARTITION MODE
reads: Total number of reads issued to this partition
read sectors: Total read sectors for partition
writes : Total number of writes issued to this partition
requested writes: Total number of write requests made for partition
FIELD DESCRIPTION FOR SLAB MODE
cache: Cache name
num: Number of currently active objects
total: Total number of available objects
size: Size of each object
pages: Number of pages with at least one active object
totpages: Total number of allocated pages
pslab: Number of pages per slab
NOTES
vmstat does not require special permissions.
These reports are intended to help identify system bottlenecks. Linux
vmstat does not count itself as a running process.
All linux blocks are currently 1024 bytes. Old kernels may report
blocks as 512 bytes, 2048 bytes, or 4096 bytes.
Since procps 3.1.9, vmstat lets you choose units (k, K, m, M) default
is K (1024 bytes) in the default mode
vmstat uses slabinfo 1.1 FIXME
FILES
/proc/meminfo
/proc/stat
/proc/*/stat
SEE ALSO
iostat(1), sar(1), mpstat(1), ps(1), top(1), free(1)
BUGS
Does not tabulate the block io per device or count the number of system
calls.
AUTHORS
Written by Henry Ware
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa