7 Karlis Salins
7 Karlis Salins
0 Performance
Tuning Best Practices
Kārlis Saliņš
Technical Support Engineer
New things in Zabbix 7.0
New processes
Adjusted health monitoring
Performance improvements
Proxy load balancing
2
New processes
Asynchronous processes
▪ SNMPAgentPoller
▪ AgentPoller
▪ HTTPAgentPoller
▪ Discoverer*
MaxConcurrentChecksPerPoller
▪ Maximum 1000 threads per worker
▪ OS configuration required
3
#Edit service file Increasing file
descriptor amount
systemctl edit zabbix-server(or proxy)
#Add these lines, numbers can be different
[Service]
LimitNOFILE=100000
TasksMax=32768
#Reload systemctl daemon Modification of service files is
required
systemctl daemon-reload
▪ Zabbix server
#Restart the service
▪ Zabbix proxy
systemctl restart zabbix-server(or proxy)
4
SMNPAgentPoller
5
Converting a custom template
Instead of discovery rule, a new walk item needs to be created
6
Converting a custom template
Discovery rule needs to be converted to dependent discovery rule
7
Converting a custom template
Discovery rule needs to be converted to dependent discovery rule
8
Converting a custom template
Use preprocessing to convert walk output to JSON on LLD rule
9
Converting a custom template
Convert item prototypes to dependent items which will take values from walk item
10
Converting a custom template
Use preprocessing to extract specific values from the master item on the item prototype
11
Converting a custom template
Use preprocessing to limit LLD rule execution time
12
Proxy memory buffer
«memory»
▪ All data gets stored in memory (RAM)
▪ No protection against data loss
«hybrid»
▪ Recommended
▪ Uses memory in most cases
▪ Data loss protection using DB
▪ Default for new installations
13
Proxy load balancing
14
Proxy LLD by Zabbix server
Zabbix server health template:
Does LLD of proxies that are
connected to the server
Creates basic items and triggers
Shows various statistics from
proxies
15
Configuration updates
16
Performance improvements
17
Zabbix internal process tuning
Workers
Caches
Managers
18
Tuning workers
Zabbix server and proxy have almost the same set of workers
20
History syncers
Causes:
Data cannot be written in the DB fast enough
Lots of triggers to be calculated
Most often DB related
Fixes:
Tune and check DB performance
Check triggers
Improve hardware
Increase history syncer amount (1 history syncer = 1000 NVPS!)
21
LLD workers
22
LLD workers
Causes:
Frequent execution of low-level discovery rules
Most often DB related
Fixes:
Tune and check DB performance
Increase update interval for low-level discovery rules
Increase “Discard unchanged with heartbeat” period for dependent low-level discovery
rules
Increase LLD workers (Every LLD worker causes huge load on DB!)
23
Tuning caches
Zabbix server and proxy have almost the same set of caches
24
Value cache
25
Value cache
Causes:
Lots of triggers
Lots of functions that use forecasting
Lots of calculated items
Fixes:
Increase ValueCacheSize (Make sure there is enough RAM on the server!)
Adjust forecast/trigger periods
26
Configuration cache
Stores configuration
Almost limitless
Never should be full, if it gets full, Zabbix server/proxy
crashes!
27
Configuration cache
Causes:
Lots of hosts, items, triggers
Fixes:
Increase CacheSize (Make sure there is enough RAM on the server!)
28
History and history index cache
History cache
Stores values after they are preprocessed
History syncer takes the values from this cache and writes them to the
database
2 GB limit
Causes:
Data cannot be written in the DB fast enough
Most of the time issues arise together with history syncer
Fixes:
Tune and check DB performance
Increase HistoryCacheSize and HistoryIndexCacheSize(Make sure there is enough RAM
on the server - this only applies if your DB is big)
30
Tuning other processes and caches
If the default settings are being used, it's acceptable for the usage to be
lower
31
Tuning managers
32
Queue
33
How to
34
Set up proxy monitoring
35
Health monitoring
36
Tuning frontend
37
Tuning frontend
38
Tuning frontend
/etc/php-fpm.d/zabbix.conf
39
Tuning databases
MySQL tunable parameters
▪ innodb_flush_log_at_trx_commit = 0
▪ innodb_flush_method = O_DIRECT
▪ optimizer_switch=index_condition_pushdown=off
▪ innodb_buffer_pool_size=(75-80% of RAM if
standalone DB or 60% if shared with the proxy)
PostgreSQL tunable parameters
▪ Use PGTune ( https://pgtune.leopard.in.ua/ )
40
Tuning triggers
Huge amount of trigger changes in a short time period creates lots of events
41
Tuning triggers
Alert fatigue
Recovery expression
42
Tuning templates
43
Thank you!
Kārlis Saliņš
Technical Support Engineer