Linux 負荷監視コマンド

vstat: システム全体の負荷
top: CPU, メモリを食っているプロセスの特定
sar: 過去の負荷の履歴
mpstat -P ALL 1: CPUコアごとの負荷
dstat -taf 標準でインストールされているコマンド
free -m メモリ
iostat -dmxt 1: IO状況

CPU使用率は $ vmstat で 100 – id の値

$ 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 0 0 2193996 89188 931568 0 0 4835 383 460 846 9 10 80 1 0
free, buff, cacheが少ないと問題
us, syがカーネル、カーネル以外のCPU使用率

$ top
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
726 root 20 0 874552 38992 20220 S 12.5 1.0 0:01.93 snapd
1 root 20 0 105056 12924 8252 S 0.0 0.3 0:02.41 systemd

$ sudo apt install dstat
$ dstat -taf
Terminal width too small, trimming output.
—-system—- –total-cpu-usage– -net/enp0s3–net/enp0s8 —paging–>
time |usr sys idl wai stl| recv send: recv send| in out >
17-08 06:52:38| 2 1 96 0 0| 0 0 : 0 0 | 0 0 >
17-08 06:52:39| 0 0 100 0 0| 180B 534B: 0 0 | 0 0 >
17-08 06:52:40| 0 1 97 2 0| 120B 220B: 0 0 | 0 0 >
17-08 06:52:41| 0 0 100 0 0| 120B 204B: 0 0 | 0 0 >^

cpu負荷をコアごと、IO負荷をディスクごと、ネットワーク転送量をインターフェイスごとに表示

https://qiita.com/aosho235/items/c4d6995743dd1dac16e1