free 简单命令查看集群内存使用状态

[root@slave03 ~]# ls a* -l;free;df
-rw-------. 1 root root 1627 Dec 14 16:28 anaconda-ks.cfg
-rw-------. 1 root root 2365 Dec 15 14:32 authorized_keys
             total       used       free     shared    buffers     cached
Mem:      20472156   14980952    5491204       1164     414076   13635068
-/+ buffers/cache:     931808   19540348
Swap:     24543228       4664   24538564
Filesystem             1K-blocks      Used  Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
                        88090904  19843724   63765748  24% /
tmpfs                   10236076        72   10236004   1% /dev/shm
/dev/vda1                 487652     77609     384443  17% /boot
/dev/mapper/VolGroup-lv_home
                       403042160 122123152  260439008  32% /home
/dev/sda             10568798112 949904364 9082022836  10% /data
[root@slave03 ~]# ls a*
anaconda-ks.cfg  authorized_keys
[root@slave03 ~]# free
             total       used       free     shared    buffers     cached
Mem:      20472156   14981076    5491080       1164     414088   13635096
-/+ buffers/cache:     931892   19540264
Swap:     24543228       4664   24538564
[root@slave03 ~]# free -g
             total       used       free     shared    buffers     cached
Mem:            19         14          5          0          0         13
-/+ buffers/cache:          0         18
Swap:           23          0         23
[root@slave03 ~]# free -m
             total       used       free     shared    buffers     cached
Mem:         19992      14630       5362          1        404      13315
-/+ buffers/cache:        910      19082
Swap:        23967          4      23963
[root@slave03 ~]# free -h
             total       used       free     shared    buffers     cached
Mem:           19G        14G       5.2G       1.1M       404M        13G
-/+ buffers/cache:       909M        18G

Swap:          23G       4.6M        23G

*这里应注意系统已用内存为909M  可用19G


  • total: 内存总数
  • used: 已经使用内存数
  • free: 完全空闲内存
  • shared: 多个进程共享的内存
  • buffers: 用于块设备数据缓冲,记录文件系统metadata(目录,权限,属性等)
  • cached: 用于文件内容的缓冲
  • Mem: 物理内存
  • -/+ buffers/cache: 基于应用角度考虑(计算已使用内存时减去buffers/cache,计算可使用内存时加上buffers/cache)的内存情况,也可理解为真实的内存使用情况.
  • Swap: 交换分区

猜你喜欢

转载自blog.csdn.net/qq_37928340/article/details/79492981