Infrastructure metrics offline? How to recover Zabbix
Learn how to diagnose Zabbix database bottlenecks, tune history cache, and restore inactive pollers with practical procedures.
Summary
- Running out of disk space and unmaintained tables will completely halt Zabbix.
- Fine-tuning the history cache prevents severe locks on the primary database.
- Stuck pollers require immediate verification of child processes and socket files.
- Slow database queries compromise the real-time delivery of critical alerts.
- Preventive purging of old historic tables restores monitoring system performance.
Why does Zabbix suddenly stop collecting metrics?
When the monitoring infrastructure goes silent, any system administrator's worst nightmare begins. Zabbix is a powerful tool that collects thousands of metrics per second, but this insatiable thirst for data can overwhelm the database if capacity planning is neglected. In practice, this means gigantic history tables begin to swallow all available storage and exhaust open connections, causing collection processes to freeze entirely.
Before blindly attempting to restart services, you must understand that Zabbix relies on a delicate ecosystem between the main server process, pollers, the relational database, and cache memory. When one of these pillars fails, a cascading effect brings down the entire system. If you have ever experienced the frustration of dealing with a slow and unresponsive database, you know that early disk I/O diagnosis is the first step to preventing a full monitoring blackout.
Diagnosing deep database bottlenecks
The beating heart of Zabbix is its database, whether PostgreSQL or MySQL/MariaDB. When the database locks up, Zabbix accumulates data in memory until the cache overflows. The most classic symptom of this is the history cache usage graph hitting 100% capacity in the Zabbix web interface. To investigate the root cause, we need to access the database server via command line and check which queries are stuck or consuming excessive processing power.
In PostgreSQL, for example, we can query system catalogs to identify active locks preventing Zabbix from writing new sensor and server readings. In practice, table locks caused by concurrent maintenance tasks or missing indexes create endless write queues. Moreover, much like investigating faults on a corrupted hard drive via CLI, thorough log checking reveals precisely which table is triggering the I/O bottleneck.
Optimizing history cache to prevent freezes
The history cache is a reserved area in RAM where Zabbix temporarily stores collected metrics before batch-writing them to the hard drive. If this cache is too small for the volume of monitored assets, the server suffers from volatile storage starvation. Adjusting this parameter requires editing the main Zabbix Server configuration file, typically located at /etc/zabbix/zabbix_server.conf, modifying specific memory allocation directives.
To apply this change safely and ensure the service restarts without out-of-memory errors, follow the sequence below directly in your Linux server terminal:
- Open the Zabbix Server configuration file with your favorite text editor using administrator privileges:
sudo nano /etc/zabbix/zabbix_server.conf - Locate the line regarding the cache parameter and increase the value according to your available RAM:
HistoryCacheSize=512M - Save the file, exit the editor, and restart the Zabbix service to apply the new memory allocation rules:
sudo systemctl restart zabbix-server
Restoring inactive pollers and stuck processes
Another common cause of monitoring failures is inactive pollers. When the database takes too long to respond, Zabbix child processes that fetch network information wait indefinitely. This exhausts the maximum number of configured pollers, leaving new requests hanging. The practical result is that hosts appear as unavailable on the main screen even though they are perfectly reachable on the network.
To resolve this, it is often necessary to increase the number of poller processes in the configuration file, allowing the system to absorb latency spikes without locking up. However, if underlying network problems exist—such as corrupted packets or physical layer instability—pollers will continue suffering timeouts. Ensuring a resilient network infrastructure is just as vital as keeping software updated, sometimes requiring techniques similar to those used to simulate packet loss and jitter in isolated environments to test alert robustness.
Final considerations on monitoring stability
Keeping Zabbix healthy requires a constant routine of preventive maintenance, cleaning old data through table partitioning, and monitoring the monitoring system itself. When we neglect database upkeep and cache sizing, the cost appears at the most critical moments, when a real corporate outage goes unnoticed precisely because the alerting system was down.
Investing time in proper performance parameter configuration and understanding your infrastructure's I/O limits ensures Zabbix fulfills its core mission: warning about problems before they impact end users. With thorough diagnostics and precise adjustments to cache and pollers, your monitoring environment will return to operating with absolute reliability.