R.A. Epigonos et al.

[linux] vmstat と free の計算

どの値がどうやって計算されているのかを調べる前に、あるコマンドの出力から計算すれば出てくるのにその出力に含まれる値を調べる。

$ free --seconds 10 --count 3 | tail --lines 4
             total       used       free     shared    buffers     cached
Mem:       1024332     880356     143976       4552     195172     201104
-/+ buffers/cache:     484080     540252
Swap:            0          0          0
$ vmstat 10 3
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 3  0      0 112604 212448 229232    0    0    96    81   75   99  4  1 93  1  1
 1  0      0 107920 212516 229728    0    0     5   592  667  820 36  8 47  1  8
 1  0      0 109440 212592 230292    0    0     6   771  698  892 40  7 48  0  4
$ free --seconds 10 --count 3 & vmstat 10 3
[1] 24848
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 3  0      0  88796 216792 247424    0    0    94    84   79  104  4  1 92  1  1
             total       used       free     shared    buffers     cached
Mem:       1024332     935660      88672       4552     216792     247424
-/+ buffers/cache:     471444     552888
Swap:            0          0          0

 1  0      0  82572 216844 247836    0    0     6   525  686  900 38  8 47  1  6
             total       used       free     shared    buffers     cached
Mem:       1024332     942380      81952       4552     216844     247836
-/+ buffers/cache:     477700     546632
Swap:            0          0          0

 1  0      0  77672 216944 248028    0    0    10   554  703  916 39  8 48  1  4
             total       used       free     shared    buffers     cached
Mem:       1024332     940540      83792       4552     216944     248028
-/+ buffers/cache:     475568     548764
Swap:            0          0          0
[1]+  Done                    free --seconds 10 --count 3
Mem total free 1024332 940540 + 83792 = 475568 + 548764
used free 940540
free free 83792
buffers free,vmstat 216944
cached free,vmstat 248028
-/+ buffers/cache used free 475568 940540 - 216944 - 248028
free free 548764 83792 + 216944 + 248028

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2008-03-01T10:03:10+09:00
  2. Modified: 2008-03-01T10:03:10+09:00
  3. Generated: 2024-11-18T23:09:16+09:00