1,检查系统内存使用情况 free
[root@k8s01 shm]# free -h total used free shared buff/cache available Mem: 7.6G 3.7G 305M 3.4G 3.7G 308M Swap: 0B 0B 0B
2,sar 命令
[root@k8s01 ~]# sar -W 5 5 Linux 3.10.0-693.el7.x86_64 (k8s01.jjqing.com) 02/21/2024 _x86_64_ (4 CPU) 10:14:43 AM pswpin/s pswpout/s 10:14:48 AM 0.00 0.00 10:14:53 AM 0.00 0.00 10:14:58 AM 0.00 0.00 10:15:03 AM 0.00 0.00 10:15:08 AM 0.00 0.00 Average: 0.00 0.00 [root@k8s01 ~]# sar -B 5 5 Linux 3.10.0-693.el7.x86_64 (k8s01.jjqing.com) 02/21/2024 _x86_64_ (4 CPU) 10:15:24 AM pgpgin/s pgpgout/s fault/s majflt/s pgfree/s pgscank/s pgscand/s pgsteal/s %vmeff 10:15:29 AM 0.80 0.00 862.20 0.20 558.20 0.00 0.00 0.00 0.00 10:15:34 AM 2.40 23.00 1967.60 0.60 489.20 0.00 0.00 0.00 0.00 10:15:39 AM 69.60 10.00 1691.40 1.40 970.20 0.00 0.00 0.00 0.00 10:15:44 AM 0.00 0.00 721.80 0.00 383.00 0.00 0.00 0.00 0.00 10:15:49 AM 0.80 16.00 1103.40 0.20 531.60 0.00 0.00 0.00 0.00 Average: 14.72 9.80 1269.28 0.48 586.44 0.00 0.00 0.00 0.00 [root@k8s01 ~]# sar -r 5 5 Linux 3.10.0-693.el7.x86_64 (k8s01.jjqing.com) 02/21/2024 _x86_64_ (4 CPU) 10:16:16 AM kbmemfree kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty 10:16:21 AM 133736 7860340 98.33 0 3971688 9895380 123.78 3997288 3619796 84 10:16:26 AM 134692 7859384 98.32 0 3971700 9895584 123.79 3997312 3619788 100 10:16:31 AM 137928 7856148 98.27 0 3971720 9889156 123.71 3994404 3619788 64 10:16:36 AM 128876 7865200 98.39 0 3971764 9904696 123.90 4000880 3619816 44 10:16:41 AM 135812 7858264 98.30 0 3973620 9889156 123.71 3994448 3621608 60 Average: 134209 7859867 98.32 0 3972098 9894794 123.78 3996866 3620159 70 [root@k8s01 ~]#