Skip to content
Tutorials Center
My learning

Topics

Lesson 26 of 37 ยท Scaling and Proxies

Zabbix Architecture and Sizing

Understand Zabbix components, the server's internal caches and poller processes, how to estimate new values per second and database size, and how to size hardware.

A Zabbix installation that watches 50 hosts runs happily on one small virtual machine. One that watches 50,000 hosts needs planning. Before you scale, you need a clear picture of the components and of the main number that drives load: new values per second (NVPS). This lesson explains both and gives you calculators to estimate disk and database size. Zabbix itself cannot run on this site, so the examples are Python stand-ins.

Components

graph LR
  A["Agents / SNMP / JMX / HTTP"] --> S["Zabbix server<br/>pollers, trappers, caches"]
  P["Zabbix proxy"] --> S
  S --> D["Database<br/>MySQL, PostgreSQL"]
  F["Web frontend<br/>PHP + nginx/Apache"] --> D
  F --> S
  W["Web service<br/>PDF reports"] --- S

Server and frontend share the database; proxies collect on behalf of the server.

  • Zabbix server: the core process. Schedules checks, receives data, evaluates triggers, sends notifications, and writes history.
  • Database: MySQL (or MariaDB), PostgreSQL (with the optional TimescaleDB extension) or Oracle in older versions. Everything lives here: configuration, history, trends, events.
  • Frontend: PHP application on nginx or Apache. It reads the database directly and talks to the server for some actions such as "Execute now" or scripts.
  • Agent / Agent 2: runs on monitored systems. Agent 2 is written in Go and supports plugins.
  • Proxy: a collector that stores data locally and forwards it (see proxies).
  • Web service: renders dashboards to PDF for scheduled reports.
  • Java gateway: translates JMX requests.

Inside the server

The server is a set of cooperating processes, each configured in zabbix_server.conf:

  • Pollers (StartPollers), unreachable pollers, HTTP pollers, ICMP pollers, SNMP pollers: actively collect passive checks.
  • Trappers (StartTrappers): accept incoming data from agents (active checks), proxies and zabbix_sender.
  • Preprocessing workers (StartPreprocessors): run item preprocessing steps.
  • History syncers (StartDBSyncers): write values to the database in batches.
  • Housekeeper: deletes expired history, trends and events.
  • Alerters, escalators, timers, LLD workers, and more.

And in memory, caches: CacheSize (configuration), HistoryCacheSize, HistoryIndexCacheSize, TrendCacheSize, ValueCacheSize (values needed for trigger functions). The built-in internal items (zabbix[wcache,values,all], zabbix[process,poller,avg,busy], zabbix[rcache,buffer,pfree]) report the load of each, and the template "Zabbix server health" ships triggers for them. Watch the busy percentage of each process type and the free percentage of every cache: those are the early warning signs.

NVPS: the number that matters

New values per second is the number of values the server must process per second. For each item type, roughly:

TEXT
NVPS = sum over items of (1 / update interval in seconds)

A host with 100 items at 60 s each adds 100/60 = 1.67 NVPS. A thousand such hosts add about 1,667 NVPS. Zabbix has handled more than 100,000 NVPS on well-tuned hardware, but the first limit you will hit is usually the database write capacity, not the CPU.

Useful rules:

  • Doubling the number of items doubles the load; halving the interval does the same.
  • Lower the update frequency before buying hardware. Many checks (installed software list, uptime) need an hour, not a minute.
  • Use dependent items so one collection yields many values (see discovery rules).
  • Triggers matter as well: a trigger with avg(/h/k,1h) needs a cache of one hour of values per item.

Storage estimate

History is stored per value; trends are one row per item per hour. Rough per-row sizes in a SQL database (including indexes) are about 90 bytes per history value for numeric items and about 90 for trends, but texts and logs can be much larger.

TEXT
history bytes = NVPS * 86400 * history_days * bytes_per_value
trends bytes  = items * 24 * trend_days * bytes_per_trend

At 1,667 NVPS with 14 days of history and 90 bytes per value, the history is about 180 GB. At 365 days of trends for 100,000 items at about 90 bytes, trends need about 80 GB.

Stand-in: capacity calculator

Python NVPS and storage estimate (Python stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Use it to test "what if" questions: change the history days from 14 to 7 and compare.

Stand-in: process busy check

The built-in zabbix[process,poller,avg,busy] item reports the average busy percentage. This stand-in applies the usual rule of thumb: raise the process count when it stays above about 50 to 60 percent, and look for the slow target before that.

Python Poller busy percentage rule (Python stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Slow checks are expensive. Three-second SNMP timeouts from unreachable devices are why unreachable pollers exist: they move such hosts out of the main poller pool.

Database advice

  • Put the database on its own server beyond about 5,000 NVPS, with SSDs or NVMe.
  • MySQL InnoDB: set innodb_buffer_pool_size to keep the working set in RAM; PostgreSQL: tune shared_buffers and use wal settings appropriate for write-heavy loads.
  • Partition large history and trend tables, or use TimescaleDB compression, instead of relying on the housekeeper alone (see database and housekeeping).
  • For availability use database replication with a standby, and Zabbix server HA (a cluster of server nodes in active-standby since 6.0).

Nagios architecture for comparison

Nagios Core runs as a single process that forks check processes. Its scheduling is plugin-centric: each check is a command that exits with a status code. There is no central database for history; add-ons write performance data to RRD or time-series stores. Scaling Nagios means distributing checks (see Nagios distributed monitoring).

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does NVPS stand for?

    NVPS is the number of values the server must process each second.
  2. 2. A host has 200 items with a 60 s interval. What is its NVPS?

    200 divided by 60 is about 3.3.
  3. 3. What is usually the first bottleneck in a large installation?

    History syncers write to the database; its I/O is commonly the limit.
  4. 4. Which component lets you add monitoring capacity near remote sites?

    Proxies collect near the targets and forward values to the server.

Summary

  • Server, database, frontend, agents, proxies and web service are the building blocks.
  • Watch process busy percentages and cache free percentages through internal items.
  • NVPS drives load; reduce intervals and item counts before adding hardware.
  • Estimate history and trend storage from NVPS, retention and row size; keep the database on fast storage.

Next: Proxies and Active versus Passive Checks