[ZBX-24785] Zabbix server - housekeeper long execution Created: 2024 Jul 04  Updated: 2025 Jul 02  Resolved: 2025 Jul 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Martin Sadovy Assignee: Karlis Salins (Inactive)
Resolution: Won't fix Votes: 5
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot from 2024-07-08 13-37-27.png     Text File housekeeper-6.2.1.txt     Text File housekeeper-7.2.5.txt     File zabbix_server.log    

 Description   

Steps to reproduce:

  1. Update zabbix server to version 7.0.0

Result:
Housekeeper execution is taking to long (0.5-2.5 hours).

Zabbix server: Utilization of housekeeper processes over 75%
Expected:
Take a shorter time.



 Comments   
Comment by Martin Sadovy [ 2024 Jul 08 ]

Before the update from 6.4.15 to 7.0.0, housekeeper took about 5 seconds, after the update about 2 hours. Database version postgresql14-14.12, timescaledb-2-postgresql-14-2.10.3. Setting for housekeeper are not changed.

Comment by Martin Sadovy [ 2024 Jul 09 ]

I have identified a potential misconfiguration in the Zabbix housekeeper settings. It appears that the housekeeper frequency value is being used as the limit in a SELECT query. This behavior seems incorrect. 

The issue seems to be in file housekeeper_server.c:

Definition of function housekeeping_events(int now, int config_max_hk_delete) <<< second param is MaxHousekeeperDelete

Calling housekeeping_events(now, housekeeper_args_in->config_housekeeping_frequency); <<< second param is HousekeepingFrequency

Tested by changing values in zabbix server configuration:

  • Default values: HousekeepingFrequency=1 and MaxHousekeeperDelete=5000
    select eventid from events where clock<1720007049 and events.source=3 and events.object=0 and not exists(select null from problem where events.eventid=problem.eventid) and not exists(select null from problem where events.eventid=problem.r_eventid) order by eventid limit 1

     

  • Changed values: HousekeepingFrequency=2 and MaxHousekeeperDelete=10000
    select eventid from events where clock<1720442002 and events.source=3 and events.object=0 and not exists(select null from problem where events.eventid=problem.eventid) and not exists(select null from problem where events.eventid=problem.r_eventid) order by eventid limit 2
Comment by Steve Taylor [ 2025 Jan 11 ]

i have the same issue sinse upgrading to 7

 

Comment by Andy Binder [ 2025 Mar 05 ]

Same issue for me. I upgraded from Zabbix 6 to 7 in Docker.

Comment by Valery [ 2025 Apr 11 ]

housekeeper-6.2.1.txthousekeeper-7.2.5.txt

The same problem after upgrading from 6.2.1 to 7.2.5

The difference  is 
for 6.2.1 "deleted 4794734 hist/trends... in 599.316635 sec"
for 7.2.5 "deleted 8327100 hist/trends... in 7135.690522 sec"

Comment by Karlis Salins (Inactive) [ 2025 Jul 02 ]

Hello.
So in the last example you are deleting almost 2x values than on 6.2.1...
Is the DB tuned?
Overall, based upon the amount of values deleted, you are collecting overall around 2k NVPS values every second.
For such environments partitioning is required.

Generated at Wed May 13 18:09:09 EEST 2026 using Jira 10.3.18#10030018-sha1:5642e4ad348b6c2a83ebdba689d04763a2393cab.