[machindra@desktop03]~% vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 0 208 83508 253692 2206428 0 0 0 14 0 1 8 3 89 0
[machindra@desktop03]~%
|
Difference between top and vmstat command:
Field descriptions of vmstat command's output:
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, shown as zero.
Vmstat command examples:
· Get vmstat five reports after 2 seconds interval as follows:
[machindra@desktop03]~% vmstat 2 5
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 0 208 83308 253692 2206428 0 0 0 14 0 1 8 3 89 0
0 0 208 83308 253692 2206428 0 0 0 0 1017 36 0 0 100 0
0 0 208 83308 253692 2206428 0 0 0 6 1017 43 0 0 100 0
0 0 208 83372 253692 2206428 0 0 0 22 1018 43 0 0 100 0
0 0 208 83372 253692 2206428 0 0 0 0 1024 40 0 0 100 0
[machindra@desktop03]~%
|
· Get size in kilobytes. Use –S for unit size and 1 1 for getting 1 report after 1 second. You can use M instead of k, to get size in Mega Bytes.
[machindra@desktop03]~% vmstat -S k 1 1
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 0 212 85315 259780 2259382 0 0 0 14 0 1 8 3 89 0
[machindra@desktop03]~%
|