Benjamin Zhang

目前就职于中科院计算机网络信息中心,主要兴趣集中在数据库,操作系统,中间件。

【zabbix】Zabbix报错:zbx_mem_realloc(): out of memory

29 Aug 2019 » zabbix

Zabbix报错:zbx_mem_realloc(): out of memory

场景:目前监控了253台虚拟机。监控项13444。昨天,出现了zabbix自动关闭的情况。查看日志如下:

zabbix server的日志位置:/var/log/zabbix/zabbix_server.log

 25364:20190827:120133.835 __mem_malloc: skipped 5 asked 335664 skip_min 904 skip_max 243104
 25356:20190827:120133.835 One child process died (PID:25358,exitcode/signal:1). Exiting ...
 25364:20190827:120133.835 [file:dbconfig.c,line:89] zbx_mem_realloc(): out of memory (requested 335664 bytes)
 25364:20190827:120133.835 [file:dbconfig.c,line:89] zbx_mem_realloc(): please increase CacheSize configuration parameter
 25364:20190827:120133.835 === memory statistics for configuration cache ===
 25364:20190827:120133.835 free chunks of size >= 256 bytes:        5
 25364:20190827:120133.835 min chunk size:        904 bytes
 25356:20190827:120135.837 syncing history data...
 25356:20190827:120135.843 syncing history data done
 25356:20190827:120135.843 syncing trends data...
 25356:20190827:120139.758 syncing trends data done
 25356:20190827:120139.780 Zabbix Server stopped. Zabbix 3.0.25 (revision 89098).

修改配置文件中的CacheSize为512M之后,继续观察

把原来的# CacheSize=8M前面的#注释去掉,将8M修改为512M

[root@localhost var]# cat /etc/zabbix/zabbix_server.conf |grep CacheSize
### Option: VMwareCacheSize
# VMwareCacheSize=8M
### Option: CacheSize
# CacheSize=8M     ----修改为512M
### Option: HistoryCacheSize
# HistoryCacheSize=16M
### Option: HistoryIndexCacheSize
# HistoryIndexCacheSize=4M
### Option: TrendCacheSize
# TrendCacheSize=4M
### Option: ValueCacheSize
# ValueCacheSize=8M