サバ管のプロなら当然知ってることでしょうけど、もう記憶力がヤバいのでメモっときます。
vmstatコマンドでは以下のオプションを知っておくと便利です。
オプション | 効果 |
---|---|
1 | 1秒毎に結果を表示 |
-w | 見出しと数字のズレを解消 |
例えば、以下の様にすると
vmstat -w 1
1秒毎にこんな結果が出てきます。
procs -------------------memory------------------ ---swap-- -----io---- --system-- -----cpu-------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 2410640 111272 654816 0 0 2 21 63 80 2 1 97 0 0
0 0 0 2410668 111272 654840 0 0 0 12 122 136 4 0 96 0 0
0 0 0 2410668 111272 654840 0 0 0 112 351 280 12 1 87 0 0
仮に-wオプションを付けなかったら
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 2401856 111656 658684 0 0 2 21 63 80 2 1 97 0 0
こんな感じになってしまって、cpuのusとかsyあたりがズレで読みにくいです。
私はこのオプションをずーっと知らずに長年イライラしてきました。。。