Zabbix supports TimescaleDB, a PostgreSQL-based database solution of automatically partitioning data into time-based chunks to support faster performance at scale.
This section provides the steps necessary for migrating from existing PostgreSQL tables to TimescaleDB.
We assume that TimescaleDB extension has been already installed in the database (see installation instructions).
TimescaleDB extension must also be enabled for the specific DB by executing:
echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql zabbix
Running this command requires database administrator privileges.
Then run the
timescaledb.sql script located in database/postgresql:
cat timescaledb.sql | sudo -u zabbix psql zabbix
Migration of existing history and trend data may take a lot of time. Zabbix server and frontend must be down for the period of migration.
timescaledb.sql script sets the following housekeeping parameters (from Administration → General → Housekeeping):
In order to use partitioned housekeeping for history and trends both these options must be on. It's possible to use TimescaleDB partitioning only for trends (by setting Override item trend period) or only for history (Override item history period).