«

zabbix配置文件优化

指尖二进制 • 1 年前 • 792 次点击 • ZABBIX


zabbix-server无法启动问题处理

经过查看日志报错如下:

16854:20190515:094058.889 __mem_malloc: skipped 8 asked 335664 skip_min 584 skip_max 218536
16854:20190515:094058.889 [file:dbconfig.c,line:94] __zbx_mem_realloc(): out of memory (requested 335664 bytes)
16854:20190515:094058.889 [file:dbconfig.c,line:94] __zbx_mem_realloc(): please increase CacheSize configuration parameter (请增加cachesize配置参数)
16854:20190515:094058.889 === memory statistics for configuration cache === 

报错里已经很明确的提示了修复办法,大致意思是说内存溢出

所以,我们就去zabbix_server.conf中找到CacheSize字段

### Option: CacheSize
#       Size of configuration cache, in bytes.
#       Shared memory size for storing host, item and trigger data.
#
# Mandatory: no
# Range: 128K-8G
# Default:
CacheSize=1024M

zabbix初始化时占用多少系统共享内存用于存储配置信息,HOST,ITEM,TRIGGER数据,视监控主机数量和监控项调整,建议调整到32M或者更大

根据监测的主机不断增多适当调大此参数


Zabbix poller processes more than 75% busy

Zabbix poller processes more than 75% busy
Zabbix Poller处理超过75%的忙

一个简单的方法是增加Zabbix Server启动时初始化的进程数量,这样直接增加了轮询的负载量,从比例上来讲忙的情况就少了。

将StartPollers改成多少取决于服务器的性能和监控的数量

### Option: StartPollers
# Number of pre-forked instances of pollers.
#
# Mandatory: no
# Range: 0-1000
# Default:
# StartPollers=5
StartPollers=20


Zabbix discoverer processes 75% busy

找到zabbix_server下的zabbix_server.conf,找到里面的StartDiscoverers,默认值是1,适当增大,3或者5都行,我改成了5,然后重新启动一下zabbix_server,看下效果。

### Option: StartDiscoverers
# Number of pre-forked instances of discoverers.
#
# Mandatory: no
# Range: 0-250
# Default:
# StartDiscoverers=1
StartDiscoverers=5


Zabbix value cache working in low memory mode

编辑zabbix_server.conf配置文件,定位到ValueCacheSize关键字位置,然后调高ValueCacheSize大小,大小根据自己环境调整

### Option: ValueCacheSize
# Size of history value cache, in bytes.
# Shared memory size for caching item history data requests.
# Setting to 0 disables value cache.
#
# Mandatory: no
# Range: 0,128K-64G
# Default:
# ValueCacheSize=8M
ValueCacheSize=20M
还没收到回复