以下のコマンドは、改めてメモしておく。
①w
②ps
③top
④free
⑤vmstat
◻️wコマンド
現在のサーバの状態を確認できる
[root@kube-admin ~]# w
09:32:17 up 21 min, 1 user, load average: 5.69, 4.64, 2.45
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 192.168.2.110 09:10 1.00s 2.94s 0.00s w
◻️psコマンド
プロセス一覧を表示
[root@kube-admin ~]# ps auxwwf
========================================================================================
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 2 0.0 0.0 0 0 ? S 09:10 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S 09:10 0:01 \_ [ksoftirqd/0]
root 5 0.0 0.0 0 0 ? S< 09:10 0:00 \_ [kworker/0:0H]
.
.
.
========================================================================================
◻️topコマンド
実行中のプロセスを確認できる。
=======================================================================================
Processes: 343 total, 5 running, 1 stuck, 337 sleeping, 1357 threads 09:34:35
Load Avg: 3.80, 3.43, 2.81 CPU usage: 20.96% user, 64.9% sys, 14.93% idle SharedLibs: 366M resident, 66M data, 45M linkedit. MemRegions: 44695 total, 6943M resident, 210M private, 1061M shared.
PhysMem: 11G used (5145M wired), 13G unused. VM: 1707G vsize, 1297M framework vsize, 0(0) swapins, 0(0) swapouts. Networks: packets: 52615/43M in, 49709/7119K out. Disks: 607103/8819M read, 837808/4432M written.
PID COMMAND %CPU TIME #TH #WQ #PORT MEM PURG CMPR PGRP PPID STATE BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS COW MSGSENT MSGRECV SYSBSD SYSMACH CSW PAGEIN IDLEW POWER INSTRS
1135 kcm 0.0 00:00.01 3 3 21 2220K 0B 0B 1135 1 sleeping *0[1] 0.00000 0.00000 0 1942 143 87 33 548 198 147 0 0 0.0 0
1133 top 2.7 00:00.75 1/1 0 26 4212K 0B 0B 1133 690 running *0[1] 0.00000 0.00000 0 5985+ 110 222464+ 111183+ 19152+ 142696+ 431+ 20 1 2.7 84571351
1132 diskmanageme 0.0 00:00.01 2 1 31 1248K 0B 0B 1132 1 sleeping *0[1] 0.00000 0.00000 0 1829 205 245 77 502 476 93 0 0 0.0 0
1128 backupd 0.0 00:00.03 2 1 44 1688K 0B 0B 1128 1 sleeping *0[1] 0.00000 0.00000 0 7681 204 353 137 1345 595 227 0 0 0.0 0
1126 ReportMemory 0.0 00:00.02 2 2 50 1200K 0B 0B 1126 1 sleeping 0[0] 0.00000 0.00000 269 1903 155 173 56 736 375 188 0 1 0.0 0
1125 com.apple.ph 0.0 00:00.11 4 4 60 6724K 0B 0B 1125 1 sleeping 0[0] 0.00000 0.00000 501 7968 606 434 136 2286 819 879 70 1 0.0 0
========================================================================================
◻️freeコマンド
メモリ使用率を確認できる。
[root@kube-admin ~]# free -m
===================================================================================================
total used free shared buff/cache available
Mem: 1838 554 375 8 909 945
Swap: 0 0 0
===================================================================================================
◻️vmstatコマンド
各種リソースの使用状況を最短で表示できる
[root@kube-admin ~]# vmstat 1 3
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
14 0 0 291680 2104 1035004 0 0 1097 678 3624 7227 31 27 39 4 0
3 0 0 314180 2104 1034592 0 0 36 1183 6951 14111 28 24 45 3 0
1 1 0 319732 2104 1035680 0 0 0 1069 6911 15572 34 29 36 1 0