10 Performance tuning

Overview

It is very important to have Zabbix system properly tuned for maximum performance.

Hardware

General advice on hardware:

Use fastest processor available

SCSI or SAS is better than IDE (performance of IDE disks may be significantly improved by using utility hdparm) and SATA

15K RPM is better than 10K RPM which is better than 7200 RPM

Use fast RAID storage

Use fast Ethernet adapter

Having more memory is always better

Operating system

Use latest (stable!) version of OS

Exclude unnecessary functionality from kernel

Tune kernel parameters

Zabbix configuration parameters

Many parameters may be tuned to get optimal performance.

zabbix_server

StartPollers

General rule - keep value of this parameter as low as possible. Every additional instance of zabbix_server adds known overhead, in the same time, parallelism is increased. Optimal number of instances is achieved when queue, on average, contains minimum number of parameters (ideally, 0 at any given moment). This value can be monitored by using internal check zabbix[queue].

See the "See also" section at the bottom of this page to find out how to configure optimal count of zabbix processes.

DebugLevel

Optimal value is 3.

DBSocket

MySQL only. It is recommended to use DBSocket for connection to the database. That is the fastest and the most secure way.

Database engine

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

use fastest database engine, i.e. MySQL or PostgreSQL

use stable release of a database engine

rebuild MySQL or PostgreSQL from sources to get maximum performance

follow performance tuning instructions taken from MySQL or PostgreSQL documentation

for MySQL, use InnoDB table structure

ZABBIX works at least 1.5 times faster (comparing to MyISAM) if InnoDB is used. This is because of increased parallelism. However, InnoDB requires more CPU power.

tuning the database server for the best performance is highly recommended.

keep database tables on different hard disks

'history', 'history_str, 'items' 'functions', triggers', and 'trends' are most heavily used tables.

top command also can be used for observing Zabbix performance. Pressing 'c' key in top shows processes with their commandlines.
In our tests on Linux top and atop correctly displayed changing activities of Zabbix processes, but htop was not displaying changing activities.

BSD systems

If watch command is not installed, a similar effect can be achieved with

while [ 1 ]; do ps x; sleep 0.2; clear; done

AIX, HP-UX

If watch command is not available, one can try

while [ 1 ]; do ps -fu zabbix; sleep 1; clear; done

Solaris

By default the ps command does not show changing activities. One option is to use /usr/ucb/ps instead.
If watch command is not installed, a periodically updated list of processes can be shown with

while [ 1 ]; do /usr/ucb/ps gxww; sleep 1; clear; done

On Solaris 11:

/usr/ucb/ps is not installed by default. You may need to install ucb package, e.g. pkg install compatibility/ucb,

if Zabbix daemon has been started by privileged user its activities are not shown to non-privileged user.

the sleep command accepts not only whole seconds but also fractions of second (e.g. sleep 0.2).