Ssup2 Blog logo Ssup2 Blog

Memory 통계 정보를 보여주는 vmstat 사용법을 정리한다.



1. vmstat

1.1. # vmstat

# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 1  1    268 782960 849224 3488324    0    0    14  1733   77   78  6  2 68 24  0
[Shell 1] vmstat

현재의 Memory 통계 정보를 출력한다. [Shell 1]은 "vmstat"을 이용하여 Memory 통계정보를 출력하는 Shell을 나타내고 있다. 각 열은 아래와 같은 의미를 나타낸다.

1.2. # vmstat [Interval] [Count]

[Interval] 간격으로 [Count] 횟수만큼 System의 전반적인 정보를 출력한다.

1.3. # vmstat -d

# vmstat -d
disk- ------------reads------------ ------------writes----------- -----IO------
       total merged sectors      ms  total merged sectors      ms    cur    sec
loop0   8669      0   21324  109832      0      0       0       0      0      4
loop1     53      0    2152    1244      0      0       0       0      0      0
loop2  11152      0   25952     712      0      0       0       0      0      0
loop3      2      0      10       0      0      0       0       0      0      0
loop4      0      0       0       0      0      0       0       0      0      0
loop5      0      0       0       0      0      0       0       0      0      0
loop6      0      0       0       0      0      0       0       0      0      0
loop7      0      0       0       0      0      0       0       0      0      0
sr0        0      0       0       0      0      0       0       0      0      0
fd0       25      0     200    1164      0      0       0       0      0      1
sda   613771  66065 10319473 12671488 4981677 7462940 1628317680 348232712      0  94326
sdb      959      0   53207   20628      0      0       0       0      0     15
[Shell 2] vmstat -d

Disk 통계정보를 출력한다. [Shell 2]는 "vmstat -d"를 이용하여 Disk 통계량을 출력하는 Shell의 모습을 나타낸다. 각 열을 아래와 같은 의미를 나타낸다.

1.4. # vmstat -p [Partition]

# vmstat -p /dev/sda2
sda2          reads   read sectors  writes    requested writes
              612711   10283732    4783736 1628860584
[Shell 3] vmstat -p

[Shell 3]은 "vmstat"을 이용하여 Memory 통계정보를 출력하는 Shell을 나타내고 있다. 각 열은 아래와 같은 의미를 나타낸다.

1.5. # vmstat -m

# vmstat -m
Cache                       Num  Total   Size  Pages
SCTPv6                       22     22   1472     22
SCTP                          0      0   1344     12
au_finfo                      0      0    192     21
au_icntnr                     0      0    768     21
au_dinfo                      0      0    128     32
ovl_inode                 14122  14122    688     23
sw_flow                       0      0   1648     19
nf_conntrack                 94    168    320     12
ext4_groupinfo_4k          1624   1624    144     28
btrfs_delayed_ref_head        0      0    152     26
btrfs_delayed_node            0      0    296     13
btrfs_ordered_extent          0      0    416     19
btrfs_extent_map              0      0    144     28
btrfs_extent_buffer           0      0    280     14
btrfs_path                    0      0    112     36
btrfs_trans_handle            0      0    120     34
btrfs_inode                   0      0   1144     14 
[Shell 4] vmstat -m

[Shell 4]은 "vmstat -m"을 이용하여 slab 통계정보를 출력하는 Shell을 나타내고 있다. 각 열은 아래와 같은 의미를 나타낸다.

2. 참조