Это перевод страницы документации с английского языка. Помогите нам сделать его лучше.

2 Proxy load balancing

Overview

Proxy load balancing allows monitoring hosts by a proxy group with automated distribution of hosts between proxies and high proxy availability.

If one proxy from the proxy group goes offline, its hosts will be immediately distributed among other proxies having the least assigned hosts in the group.

Host redistribution happens only in "online" proxy groups. A proxy group is "online" if the configured minimum number of its proxies are online.

The proxy state is:

  • online - if there was communication with it for the failover delay period (passive proxy responded to server requests and active proxy sent a request to server);
  • offline - if there was no communication with it for the failover delay period;
  • unknown - after proxy creation or server start.

Zabbix server also checks the balance between host-proxy assignments. If the balance is bad the group is marked for host reassignment, which will be done after 10xfailover delay period unless the balance is restored. The group is considered to be unbalanced if the number of hosts assigned to a proxy differs from the average (within the group) by at least 10 hosts and factor of 2.

Note that older version proxies and the hosts monitored by these proxies are excluded from re-balancing operations until they are upgraded.

Host redistribution

Proxy load balancing and high availability is managed by Zabbix server via the proxy group manager, which continuously monitors the state of all proxies in each proxy group and their host distribution.

Proxy high availability within a group is triggered when a proxy goes offline—its hosts are immediately redistributed to other proxies. Proxy load balancing also occurs, as hosts are reassigned to proxies with the fewest assigned hosts.

Additionally, proxy load balancing is triggered when proxy host count differs from the group average by at least 10 hosts and a factor of 2 (host excess or host deficit). If the imbalance persists after a grace period (10 x failover delay), the proxy group is queued for host redistribution.

The proxy group manager redistributes hosts using the following logic:

  1. Calculate the average number of hosts per proxy.
  2. For proxies with host excess—move the excess hosts to the unassigned pool of proxies.
  3. For proxies with host deficit—calculate how many hosts are needed to reach balance.
  4. Remove the required number of hosts from proxies with the most hosts.
  5. Move unassigned hosts to proxies with the fewest hosts.

Examples of host redistribution:

Hosts on proxy Group average Host reassignment
100 50 Yes
60 50 No
40 50 No
25 50 Yes
15 5 Yes
10 5 No

Hosts monitored by a single proxy (even if it belongs to a proxy group) are not involved in load balancing/high availability. Additionally, having fewer than 10 hosts monitored by a proxy group may lead to uneven host distribution among proxies in the group.

Configuring a proxy group

To configure a proxy group in Zabbix frontend:

  • Go to: Administration → Proxy groups
  • Click on Create proxy group

Parameter Description
Name Enter the proxy group name.
Failover period Enter the period in seconds before failover is executed (1m by default; allowed range 10s-15m).
Time suffixes are supported (e.g., 30s, 1m).
User macros are supported.
Minimum number of proxies Enter the minimum number of online proxies required for the group to be online (1 by default; allowed range 1-1000).
User macros are supported.
Description Enter the proxy group description.
Proxies List of proxies in the group. Up to five proxies can be displayed (as links or in plain text, depending on permissions to the proxy).
This list is displayed when editing an existing proxy group, if there is at least one proxy in the group.

Configuring proxy load balancing

To configure proxy load balancing for monitoring hosts:

  1. Create a proxy group (see "Configuring a proxy group" below).

  2. Make sure the proxy group is online.

  3. Configure that hosts are monitored by proxy group (not individual proxies). You may use host mass update to move hosts from proxy to the proxy group.

Hosts that are monitored by a single proxy (even if the proxy is part of proxy group) are not involved in load balancing/high availability at all.

  1. Wait a few seconds for configuration update and for host distribution among proxies in the proxy group. Observe the change by refreshing the host list in Monitoring -> Hosts.

Note that adding all proxies of the group to the ServerActive agent parameter of monitored hosts is beneficial, but not mandatory. Proxy load balancing will work even with a single proxy added to ServerActive - active checks (and Zabbix sender data requests) will be redirected to the correct online proxy for the host based on the current proxy-host assignment.

When a host is created based on auto registration/network discovery data from a proxy belonging to proxy group - then this host is set to be monitored by this proxy group.

Testing proxy load balancing

To test proxy load balancing:

  1. Configure a proxy group.
  2. Make sure that the proxy group has an online state.
  3. Make sure that hosts are monitored by a proxy group, not individual proxies (you may use host mass update to move hosts from proxies to the proxy group).
  4. Wait a few seconds for the configuration update and host distribution among proxies in the proxy group. Observe the change by refreshing the host list in Monitoring > Hosts.
Limitations
  • SNMP traps are not supported by proxies in proxy group.
  • Checks depending on external configuration must have the same configuration on all proxies in proxy group. That includes:
    • external checks - scripts;
    • database checks - odbc configuration.
  • When monitored in proxy group the VMware hosts will be randomly spread between proxies in the group and will cause each proxy to cache all VMware data causing additional load to vCenter.