服务器突然掉在空闲的内存,但仍然运行良好

我正在运行8GB内存Debian 8。 同时运行Zabbix并添加了显示空闲内存的自定义项目:

vm.memory.size[free] 

根据Zabbix的消息,它已经运行了数周,拥有大约4GB的可用内存。 突然,超过3天,它已经下降到200MB左右的空闲内存,但仍然运行良好。

在terminal这是免费的节目:

 free -m total used free shared buffers cached Mem: 7998 7745 252 42 142 7284 -/+ buffers/cache: 319 7679 Swap: 2047 0 2046 

男人之前:免费赠送4GB左右,现在只有252MB。 但缓冲区/caching显示很多免费。

我正在运行PostgreSQL作为唯一的应用程序。

我该怎么做才能最好地了解机器中发生的事情? 我会对可用/可用内存的真实看法,所以我知道何时增加更多的内存,而不是担心 – 就像我现在。

Zabbix图表的截图: http : //imgur.com/a/lgyMD

更新:

运行提供顶级'%MEM':

 24091 postgres 20 0 226720 65664 64216 S 1.7 0.8 0:03.19 postgres 24100 postgres 20 0 227756 57148 54840 S 0.7 0.7 0:04.24 postgres 24103 postgres 20 0 227736 56400 54072 S 0.7 0.7 0:03.76 postgres 24095 postgres 20 0 227748 55960 53652 S 0.3 0.7 0:03.63 postgres 24102 postgres 20 0 227736 55956 53628 S 1.7 0.7 0:03.69 postgres 24104 postgres 20 0 227720 55576 53244 S 0.3 0.7 0:03.59 postgres 24098 postgres 20 0 227748 55572 53264 S 0.3 0.7 0:03.86 postgres 24099 postgres 20 0 227744 55284 52972 S 0.3 0.7 0:04.55 postgres 24097 postgres 20 0 227720 55184 52860 S 0.3 0.7 0:03.98 postgres 24101 postgres 20 0 227704 54924 52600 S 3.0 0.7 0:04.37 postgres 24096 postgres 20 0 227724 54364 52048 S 0.3 0.7 0:03.09 postgres 24090 postgres 20 0 226824 30460 28956 S 0.0 0.4 0:01.40 postgres 24077 postgres 20 0 226720 21600 20204 S 0.0 0.3 0:00.07 postgres 24092 postgres 20 0 226720 8744 7304 S 0.0 0.1 0:00.06 postgres 24093 postgres 20 0 227144 7132 5456 S 0.0 0.1 0:00.14 postgres 25860 root 20 0 82592 5956 5104 S 0.0 0.1 0:00.00 sshd 520 root 20 0 55184 5324 4652 S 0.0 0.1 0:00.01 sshd 1695 zabbix 20 0 83064 5076 3968 S 0.0 0.1 2:00.49 zabbix_agentd 1696 zabbix 20 0 83064 5076 3968 S 0.0 0.1 2:04.55 zabbix_agentd 1694 zabbix 20 0 83064 5072 3968 S 0.0 0.1 2:05.60 zabbix_agentd 25864 johndoe 20 0 23152 4824 3132 S 0.0 0.1 0:00.04 bash 176 root 20 0 32968 4524 4376 S 0.0 0.1 0:14.79 systemd-journal 26157 root 20 0 18248 4396 3908 S 0.0 0.1 0:00.00 cdm 24094 postgres 20 0 82008 4212 2716 S 0.0 0.1 0:00.56 postgres 541 root 20 0 19008 4176 3688 S 0.3 0.1 39:54.46 controller 1 root 20 0 28600 4096 2604 S 0.0 0.1 0:08.97 systemd 1697 zabbix 20 0 83064 3876 2872 S 0.0 0.0 20:35.93 zabbix_agentd 26345 root 20 0 15236 3684 3340 S 0.0 0.0 0:00.19 hdb 25878 root 20 0 21904 3668 3128 S 0.0 0.0 0:00.01 bash 25863 johndoe 20 0 82724 3608 2760 S 0.0 0.0 0:00.52 sshd 587 root 20 0 20824 3592 2556 S 0.0 0.0 0:23.24 xe-daemon 26274 root 20 0 12404 3516 3160 S 0.0 0.0 0:00.00 processes 1693 zabbix 20 0 83064 3348 2372 S 0.0 0.0 23:07.61 zabbix_agentd 178 root 20 0 41524 3340 2100 S 0.0 0.0 0:00.24 systemd-udevd 26332 root 20 0 12124 3232 2948 S 0.0 0.0 0:00.00 spooler 1692 zabbix 20 0 83064 3184 2208 S 0.0 0.0 0:00.00 zabbix_agentd 25877 root 20 0 46360 3016 2640 S 0.0 0.0 0:00.01 su 531 message+ 20 0 42124 2960 2572 S 0.0 0.0 0:00.01 dbus-daemon 26405 root 20 0 23664 2940 2420 R 0.0 0.0 0:00.03 top 551 root 20 0 258668 2848 2088 S 0.0 0.0 0:00.66 rsyslogd 504 statd 20 0 37280 2616 2028 S 0.0 0.0 0:00.00 rpc.statd 522 root 20 0 27476 2532 2284 S 0.0 0.0 0:12.44 cron 495 root 20 0 37080 2464 2056 S 0.0 0.0 1:16.15 rpcbind 1029 Debian-+ 20 0 51176 2420 1788 S 0.0 0.0 0:00.29 exim4 525 root 20 0 19856 2336 2068 S 0.0 0.0 1:50.77 systemd-logind 567 root 20 0 14236 2088 1936 S 0.0 0.0 0:00.00 agetty 566 root 20 0 14416 1872 1724 S 0.0 0.0 0:00.02 agetty 523 daemon 20 0 19024 1788 1624 S 0.0 0.0 0:00.74 atd 539 root 20 0 9948 1360 1228 S 0.0 0.0 10:58.89 nimbus 26401 root 20 0 4236 672 596 S 0.0 0.0 0:00.00 sleep 518 root 20 0 23356 204 0 S 0.0 0.0 0:00.00 rpc.idmapd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd 3 root 20 0 0 0 0 S 21.0 0.0 411:38.80 ksoftirqd/0 

最终更新

PostgreSQL是保留内存似乎是:

 /proc/meminfo MemTotal: 8190432 kB MemFree: 123344 kB MemAvailable: 7627732 kB Buffers: 22156 kB Cached: 7650496 kB 

Linux Kernel发现适合于caching的服务器上有更多的内容。

正如您从free -m输出中所看到的,大部分内存都用于文件系统caching,这是“未使用”内存的最佳使用方式。 您可能想阅读http://linuxatemyram.com/看看发生了什么。