zabbix_server优化:
# cat zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/var/lib/mysql/mysql.sock
DBPort=3306
StartPollers=160
StartTrappers=20
StartPingers=100
StartDiscoverers=20
MaxHousekeeperDelete=5000
CacheSize=1024M
StartDBSyncers=16
HistoryCacheSize=1024M
TrendCacheSize=1024M
HistoryTextCacheSize=512M
AlertScriptsPath=/etc/zabbix/alertscripts
LogSlowQueries=1000
FpingLocation=/usr/sbin/fping
ValueCacheSize=512M
Timeout=30
zabbix_agentd优化:
cat /etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=10
EnableRemoteCommands=1
LogRemoteCommands=1
Server=127.0.0.1,10.192.1.21
StartAgents=5
ServerActive=10.192.1.21:10051
Hostname=DTS-2
Include=/etc/zabbix/zabbix_agentd.conf.d/
UnsafeUserParameters=1
UserParameter=http_request[*],/usr/bin/curl -o /dev/null -s -w %{http_code} $1
Timeout=30
service zabbix_agentd restart
service zabbix-agent restart
调整内核参数: /etc/sysctl.conf sysctl -p
net.ipv4.tcp_keepalive_time = 1800
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1