Zabbix proxy is more than just a tool for distributed monitoring. It’s hard to run a huge Zabbix installation without proxies. So let them do the dirty job.
Watch the video now.
You should definitely use Zabbix proxies, and in this post I will explain what their benefits are. A Zabbix proxy is a free-of-charge tool with an unlimited number of installations. Instead of having one simple standalone Zabbix server, you can have it with hundreds of proxies working as separate machines in your environment.
Note. I will not cover the process of installation and configuration of a Zabbix proxy, so if you are new to Zabbix go to one of my earlier videos first.
The main benefit of proxies in terms of performance is that the load is redistributed from your Zabbix server to proxies.
Usually, your Zabbix server installation supports a lot of processes and the number increases as your environment grows. In production, there might be more than 500 internal processes: configuration syncers, pollers, trappers, etc. Each of those processes is responsible for certain checks to retrieve data. The checks take time, ranging from fractions of a second to a full second. Some are faster than others, and some are slower, depending on the item type.
You can check the time that it takes to perform a check with the following command:
time zabbix_get -s [localhost_IP] -k [name_of_the_parameter]
From a quick look at it, it may seem like most of the checks are happening quite fast. But in huge Zabbix installations, the time can have a big difference. If you have 1,000 hosts on which you monitor the same parameter and on each host the check takes around 0.3 s, then you will have to spend around 5 min to get just that parameter data from each machine — and that’s just one parameter.
One of the hidden and greatest benefits of proxies is offloading the Zabbix server. A Zabbix proxy has the same internal processes as the Zabbix server, for example, pollers, preprocessors, and trappers.
A Zabbix proxy is the ideal solution if you have numerous hosts with multiple slow items that are affecting the performance of the server simply because processes are spending most of the time simply waiting for a response. A proxy can collect information from all hosts using its internal processes and then send raw historical data to the server. The time needed to connect and receive the host response will be on the proxy site, and the server performance will not be affected at all. A proxy just sends raw values to the server, and the server itself does not have to connect to the host to get the data.
Proxies also come with a separate database. It can store the data if you have network communication issues between the Zabbix server and the proxy.
A proxy should be your first choice for remote monitoring if you have branches or offices in different cities.
If you have virtual networks not accessible by the Zabbix server, you have to install the proxy and choose the preferred method of communication (active or passive).
New in 4.2
Before Zabbix 4.2, proxies only collected data from the host and passed it to the server where all preprocessing steps, triggers, calculations, actions, and notifications were executed.
Starting with version 4.2, preprocessing is performed on the proxy side if the host is monitored by the proxy. There are many default items that are configured with preprocessing steps.
Since preprocessing is performed on the proxy side, the server only collects data, processes triggers, and executes actions.
Don’t get me wrong — it’s not mandatory to use proxies. A Zabbix server is powerful enough to work on its own. It is possible to have only one Zabbix server installation with thousands of items and hosts and collect all the data without the proxy — and that will work perfectly well.
However, if you want to get the best performance out of your environment without investing extra money into the Zabbix server specifications (for example, CPU or memory), you might consider not only adjusting the configuration of the server and the database, optimizing update intervals by following the performance suggestions and the best practices, but also installing proxies. Proxies do not have to run on powerful machines, just two cores and 4 GB will be enough to process a significant amount of the data and offload the server.
To get the most out of Zabbix before investing in hardware, I strongly recommend to use proxies and move all checks to them instead of the server. You will surely notice the difference.