zabbix4.0 performance tuning

Posted by Darkpower on Fri, 18 Oct 2019 10:53:37 +0200

##Performance tuning
Overview
It's important to get the Zabbix system tuned for optimal performance.

Hardware

- use the fastest processor
- SCSI or SAS is better than IDE (by using the utility hdparm you can significantly improve the performance of IDE disks) and SATA
- 15K RPM better than 10K RPM, better than 7200 RPM
- use fast RAID storage
- use fast Ethernet adapter
- it's always better to have more memory
 
operating system
- use the latest (stable!) Version of the operating system
- exclude unnecessary functions from the kernel
- adjust kernel parameters
 
* Zabbix configuration parameters**
 
- many parameters can be adjusted for optimal performance.

zabbix_server
StartPollers

- the general rule keeps the value of this parameter as low as possible. Each additional instance of ZABBIX? Server increases the known overhead and parallelism. The optimal number of instances is achieved when the queue contains the minimum number of parameters on average (ideally 0 at any given time). You can use the internal check zabbix [queue] to monitor this value.

**DEBUGLEVEL**

- the best value is 3.

**DBSocket**

- MySQL only. It is recommended to use DBSocket to connect to the database. This is the fastest and safest way.

database engine
This is probably the most important part of Zabbix tuning. Zabbix largely depends on the availability and performance of the database engine.

- use the fastest database engine, MySQL or PostgreSQL
- use a stable version of the database engine
- rebuild MySQL or PostgreSQL from source for maximum performance
- follow the performance tuning instructions obtained from MySQL or PostgreSQL documentation
For MySQL, use InnoDB table structure
- ZABBIX works at least 1.5 times faster (compared to MyISAM) if InnoDB is used. This is due to increased parallelism. However, InnoDB needs more CPU power.
- tuning the database server for optimal performance is highly recommended
- save database tables on different hard disks
'history', 'history_str', 'items' functions', triggers' and' trend 'are the most commonly used tables.
- for large installations where temporary MySQL files are saved in tmpfs: MySQL > = 5.5: not recommended (MySQL bug 58421) MySQL
< 5.5: Recommended

**GUI debugging**

- you can use the front-end debugging mode to diagnose problems related to front-end performance.

General recommendation

- monitor only required parameters
- adjust the update interval for all items. Keeping the update interval small may be good for beautiful graphics, but it may overload Zabbix
- adjust the parameters of the default template
- adjust Butler parameters
- do not monitor parameters that return the same information.
- avoid using triggers given as function parameters for a long time. For example, the calculation speed of max (3600) is significantly slower than that of max (60).
 
Use "ps" and "top" to view Zabbix process performance
Because the Zabbix 2.2 process changes its command line to display current activity and meaningful statistics, for example:

UID PID PPID C STIME TTY TIME CMD  
zabbix22 4584 1 0 14:55?00:00:00 zabbix\_server -c /home/zabbix22/zabbix\_server.conf  
zabbix22 4587 4584 0 14:55?00:00:00 zabbix_server: To configure syncer \[Synchronization configuration 0.041169 Seconds, 60 seconds free\]  
zabbix22 4588 4584 0 14:55?00:00:00 zabbix_server: db watchdog \[Sync alert configuration 0.018748 Seconds, 60 seconds free\]  
zabbix22 4608 4584 0 14:55?00:00:00 zabbix_server: timer#1 \[Updated 0 hosts at 0.000472 0 events forbidden in seconds, 59 seconds idle\]  
zabbix22 4637 4584 0 14:55?00:00:01 zabbix_server: history syncer#3 \[Process 0 value, 0 triggers 0.000036 Seconds, 1 second idle\]  
zabbix22 4657 4584 0 14:55?00:00:00 zabbix_server: vmware collector#1 \[Updated 0, deleted 0 VMware Service, 0.000004 Seconds, 5 seconds free\]  
zabbix22 4670 1 0 14:55?00:00:00 zabbix\_proxy -c /home/zabbix22/zabbix\_proxy.conf  
zabbix22 4673 4670 0 14:55?00:00:00 zabbix_proxy: To configure syncer \[synced config 15251 bytes in 0.111861 sec,idle 60 sec\]  
zabbix22 4674 4670 0 14:55?00:00:00 zabbix_proxy: Heartbeat sender\[Sending heartbeat message succeeded 0.013643 Seconds, 30 seconds free\]  
zabbix22 4688 4670 0 14:55?00:00:00 zabbix_proxy: icmp pinger#1 \[At 1.811128 Get 1 value in seconds, idle for 5 seconds\]  
zabbix22 4690 4670 0 14:55?00:00:00 zabbix_proxy: Housekeeper\[9870 records deleted at 0.233491 Seconds, 3599 seconds idle\]  
zabbix22 4701 4670 0 14:55?00:00:08 zabbix_proxy: http poller#2 \[Get 1 value 0.024105 Seconds, 1 second idle\]  
zabbix22 4707 4670 0 14:55?00:00:00 zabbix_proxy: history syncer#4 \[Process 0 value, 0 triggers 0.000039 Seconds, 1 second idle\]  
zabbix22 4738 1 0 14:55?00:00:00 zabbix\_agentd -c /home/zabbix22/zabbix\_agentd.conf  
zabbix22 4739 4738 0 14:55?00:00:00 zabbix_agentd: collector\[Idle for 1 second\]  
zabbix22 4740 4738 0 14:55?00:00:00 zabbix_agentd: Monitor#1 \[Waiting for connection\]  
zabbix22 4741 4738 0 14:55?00:00:00 zabbix_agentd: monitor#2 \[Processing request\]  

The main process is an exception. Instead of the current activity, the original command line is displayed. This helps distinguish processes on systems with multiple Zabbix instances.

Microsoft Windows does not implement this feature.

If the logging level is set to DebugLevel = 4, these activities and statistics are also written to the log file.

Topics: Operation & Maintenance Zabbix MySQL Database RPM