RHEL9 メモリ,CPU,プロセスを確認する方法

環境
Red Hat Enterprise Linux release 9.2 (Plow)

操作例
1.メモリの使用量を確認する(free)

# free -b
total used free shared buff/cache available
Mem: 3811569664 1125511168 2078027776 16269312 878698496 2686058496
Swap: 2147479552 0 2147479552

説明
free -bは、メモリの容量と使用量をバイト単位で表示します。
totalは、メモリの容量です。Memは1GBあります。
usedは、使用量です。Memは700MB使用しています。
freeは、空きの容量です。
sharedは、共有メモリです。
buff/cacheは、バッファのキャッシュとページのキャッシュです。

2.「free -k」でメモリの容量と使用量をキロバイト単位で表示します。
操作例

# free -k
total used free shared buff/cache available
Mem: 3722236 1099124 2029324 15884 858092 2623112
Swap: 2097148 0 2097148

3.「free -m」を使ってメモリの容量と使用量をメガバイト単位で表示します。

# free -m
total used free shared buff/cache available
Mem: 3634 1073 1981 15 837 2561
Swap: 2047 0 2047

4.vmstatでメモリ、IO、CPUの状況を表示する

# vmstat
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 2029100 2780 855352 0 0 2 3 77 74 1 4 95 0 0

2行目は、ヘッダ項目です。プロセス、メモリ、swap、IO、システム、CPUがあります。

IT

Posted by arkgame