I've got a Zabbix 4.2 install, and I need to shave down the History tables in preparation for a server migration and upgrade.
The original settings were 3w days History and 90d Trends, I've gradually been dropping these settings and manually re-running the housekeeper, but the number of records processed by the housekeeper seems to stay static. These tables look to be sparse files, but if I check their real size with either du. or use mysqltuner to check how much space an Optimise table would free up, there have been no significant changes.The operation takes maybe <10 minutes to run each time, and doesn't seem to be hammering the box resource wise.
zabbix 20578 0.5 0.1 971848 125996 ? 0:05 /usr/sbin/zabbix_server: housekeeper [deleted 11041507 hist/trends, 0 items/triggers, 76268 events, 1 sessions, 0 alarms, 8 audit items, 0 records in 385.297637 sec, idle for 1 hour(s)]
In addition, if I check the oldest records present in the history tables, there are still records present from 3 weeks ago.
MariaDB [zabbix]> SELECT FROM_UNIXTIME(clock) FROM history_uint LIMIT 3;
+----------------------+
| FROM_UNIXTIME(clock) |
+----------------------+
| 2022-12-17 16:18:08 |
| 2022-12-17 16:19:08 |
| 2022-12-17 16:20:08 |
+----------------------+
3 rows in set (0.00 sec)
In addition, I've tried upping the MaxHousekeeperDelete setting initially to 50000 and then to 9(Unlimited), but this equally has no effect on the amount of records cleared per run, which has remained surprisingly
zabbix 20578 0.5 0.1 971848 125996 ? 0:05 /usr/sbin/zabbix_server: housekeeper [deleted 11041507 hist/trends, 0 items/triggers, 76268 events, 1 sessions, 0 alarms, 8 audit items, 0 records in 385.297637 sec, idle for 1 hour(s)]
I can also see a DELETE operation running in MySQL, but if I convert the clock time to normal, it's from 3 weeks ago (1671337088 = Sun Dec 18 2022 04:18:08), so Zabbix looks to still be sending the previous retention setting into the query.
| 1335 | zabbix | localhost | zabbix | Query | 0 | query end | delete from history where itemid=200200000069556 and clock<1671337088 | 0.000 |
Does anybody have any idea what the issue could be? I've tried multiple service restarts and server reboots, and even (as this is a sandboxed test copy of the box) and even an upgrade to 4.4.10 as this is part of the upgrade plan anyway, but nothing has seemed to have any effect.
It has already gone from 30 to 18... just 4 days to go..:P
Comment