[ZBXNEXT-207] Scheduled Housekeeping Created: 2010 Jan 19  Updated: 2015 Sep 29  Resolved: 2015 Feb 21

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Proxy (P), Server (S)
Affects Version/s: None
Fix Version/s: 2.5.0

Type: Change Request Priority: Major
Reporter: Peteris Assignee: Unassigned
Resolution: Fixed Votes: 45
Labels: housekeeper
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate

 Description   

To manage workloads on Zabbix server Housekeeping feature should me more adjustable by adjusting start time of housekeeping event and/or inventing command line/frontend tools to initiate start of housekeeping process.

At this moment there is only possibility to set amount of housekeeping operations in 24 hours. I would like to set also a start time of Housekeeping operations, for example, if housekeeping option is set to 1 you can specify that housekeeping starts at 00:00, so this operation doesn't load Zabbix server at day time.

It would be great if housekeeping event could start from Command line and/or Frontend. If there would be a command line tool for housekeeping, administrators could make their own schedulers of housekeeping using cron jobs.



 Comments   
Comment by richlv [ 2010 Jan 19 ]

most likely - a switch for zabbix_server which signals a running server instance to start housekeeping. that could also be added as a script from a frontend etc

Comment by chlunde [ 2010 Jul 13 ]

I think this should be handled as two separate issues:
1) Specifying the housekeeping period(s) in the configuration file
2) Reloading the configuration file (safe options) without restart, this would satisfy the need for users wanting cronjobs to do fancy stuff (if such users exists?)

Our system has a fairly large housekeeping backlog so I would like to implement part 1. Part 2 is not important for me.

Suggested specification/implementation of part 1:
New configuration parameter:
HousekeepingPeriod
Simple example, run nightly all days:
1-7,00:00-07:00
Complex example, run outside workhours:
1-5,00:00-08:00;1-5,16:00-23:59;6-7,00:00-23:59;
An empty or undefined value behaves as the current implementation - i.e. runs all day with the specified HousekeepingFrequency.

All loops in the housekeeper process should stop when they are outside the configured period and sleep. Ideally the process should wake at the beginning of each configured period. This parameter combined with high values for HousekeepingFrequency could give some weird results, so HousekeepingFrequency=1 is probably best?

Alexei/Rich - do you think such an implementation would be accepted?

Comment by Simon [ 2010 Aug 03 ]

Any news about this feature ?

I'm also think it could be great if we could define when the housekeeping start.

Comment by richlv [ 2011 Mar 04 ]

generic runtime server control : ZBXNEXT-416
forced item check : ZBXNEXT-653

Comment by Andy Goldschmidt [ 2011 Aug 03 ]

Please implement this - very useful.

Comment by Sergey Vinogradov [ 2011 Aug 05 ]

I agree, this functionality will be very useful.

Comment by Guy Inigo [ 2012 Aug 08 ]

I would like to know if the implementation of this feature is planned for a next release?

It is a vital principle to be able to schedule resources consuming tasks.

Comment by richlv [ 2012 Aug 08 ]

there actually is some discussion about redesigning retention configuration to make housekeeper potentially unnecessary in the future, so housekeeper improvements currently are on hold

Comment by Alex Vorona [ 2012 Aug 09 ]

Using SSD for DB makes housekeeping impact on system load relatively low. We had forgot about housekeepeng after migrating to SSD.

Comment by Stefan [ 2012 Aug 09 ]

@richlv: table-partitioning?!

Comment by David Dixon [ 2013 Jul 12 ]

I agree, being able to schedule housekeeping to a specific time is very important - Zabbix is borderline unusable when it is running.

Comment by hdwtpl hdwtpl [ 2013 Oct 29 ]

Housekeeper starts if zabbix_server starts. Just create a cronjob to restart the zabbix_server and change the HouseKeepingFrequency to 24 in the zabbix_server.conf.

Comment by Raymond Kuiper [ 2014 Sep 12 ]

Steve Mushero talked about this during the Zabbix Conference 2014. Apparently he has a solution for this.
I'd also like this feature implemented, perhaps his patch can be used as a basis?

Comment by Igors Homjakovs (Inactive) [ 2014 Oct 02 ]

Fixed in svn://svn.zabbix.com/branches/dev/ZBXNEXT-207

Comment by Oleksii Zagorskyi [ 2014 Oct 03 ]

missing specification ....

wiper right, that would have helped to avoid a misunderstanding in current implementation

wiper I added housekeeper information to https://www.zabbix.org/wiki/Docs/specs/ZBXNEXT-101 (we should copy it to some other place for generic specifications).

Comment by Andris Zeila [ 2014 Oct 03 ]

(1) The config_cache_reload message should keep the old format and also the new housekeeper_execute message should be sent without defining target scope (like config_cache_reload).

Please review my changes in r49585

igorsh Thank you. Looks good.

wiper CLOSED

Comment by Andris Zeila [ 2014 Oct 03 ]

(2) Housekeeper wakeup should be renamed to housekeeper execute (in command line options and constant definitions).

igorsh RESOLVED in r49588.

wiper CLOSED

Comment by Igors Homjakovs (Inactive) [ 2014 Oct 03 ]

(3) man pages and documentation have to be updated

man pages have been updated in r49592.

wiper CLOSED

Comment by Andris Zeila [ 2014 Oct 06 ]

(4) Allow setting HousekeepingFrequency option in configuration file to zero to disable automatic housekeeping. This will allow to use only manual (scheduled) housekeeping procedures.

The following steps must be implemented:

  1. allow HousekeepingFrequency option to accept zero value
  2. add a function zbx_sleep_forever(), which would sleep until zbx_wakeup() is called
  3. update housekeeper process to use zbx_sleep_forever() if HousekeepingFrequency is set to zero

igorsh RESOLVED in r49907, r49912, r49913.

wiper CLOSED

Comment by Andris Zeila [ 2014 Oct 09 ]

The specifications were created https://www.zabbix.org/wiki/Docs/specs/ZBXNEXT-207

Comment by Janne Korkkula [ 2014 Oct 13 ]

It'd also be good to be able to configure the range the housekeeper cleans up in one run, not just a fixed 4x last sleeptime.

Comment by richlv [ 2014 Oct 13 ]

configuring the range would be a separate feature request, though

Comment by Janne Korkkula [ 2014 Oct 14 ]

The original requestee may or may not know what's happening under the hood and how the change may effect performance. Going from short housekeeping intervals to a once-per-night run may kill some servers which have more than the normal amount of cleanup to do. Implementing at least a configurable factor at the same time would be smart.

Comment by Andris Zeila [ 2014 Oct 14 ]

The cleanup interval must greater than the time between cleanups. So going from short intervals to a nightly run would require the cleanup interval to be at 24+ hours anyway.

Comment by Andris Zeila [ 2014 Oct 23 ]

(5) Documentation must be updated:

  1. new runtime control option -R housekeeper_execute
  2. disabling automatic housekeeping procedure by setting HousekeepingFrequency to 0 in server/proxy configuration files

igorsh RESOLVED in

https://www.zabbix.com/documentation/3.0/manual/introduction/whatsnew300
https://www.zabbix.com/documentation/3.0/manual/concepts/server
https://www.zabbix.com/documentation/3.0/manual/concepts/proxy
https://www.zabbix.com/documentation/3.0/manual/appendix/config/zabbix_server
https://www.zabbix.com/documentation/3.0/manual/appendix/config/zabbix_proxy

wiper CLOSED

Comment by Andris Zeila [ 2014 Oct 23 ]

Successfully tested, but please review coding style and HousekeepingFrequency description changes in r50116

igorsh Thank you. The canges look good.

Comment by Igors Homjakovs (Inactive) [ 2014 Oct 23 ]

(6) Perhaps help info also has to be updatated.

Now:

    Runtime control options:
      config_cache_reload               Reload configuration cache
      housekeeper_execute               Execute the housekeeper

but it should be like that

    Runtime control options:
      config_cache_reload               Reload configuration cache. Ignored if cache is being currently loaded.
      housekeeper_execute               Execute the housekeeper. Ignored if housekeeper is being currently executed.

wiper I'm not sure if I'd mention it even in manual.

<richlv> we mention it for the config cache reload in the manpages, but not in the help message - i would do the same for the housekeeper

igorsh Then it stays unchanged. CLOSED.

Comment by Andris Zeila [ 2014 Oct 24 ]

(7) Please take a look at r50146, r50147. It fixes few issues on systems without sigqueue support.

igorsh Thank you. CLOSED

Comment by Igors Homjakovs (Inactive) [ 2014 Oct 24 ]

Fixed in 2.5.0 (trunk) r50157.

Comment by Igors Homjakovs (Inactive) [ 2014 Oct 24 ]

(8) Man pages have to be updated:

https://www.zabbix.com/documentation/3.0/manpages/zabbix_server
https://www.zabbix.com/documentation/3.0/manpages/zabbix_proxy

<richlv> synced web versions from the manpages, RESOLVED

igorsh CLOSED

Comment by Alexander Vladishev [ 2015 Feb 10 ]

(9) Broken reloading of configuration cache on proxy side

Available in svn://svn.zabbix.com/branches/dev/ZBXNEXT-207 r52148.

RESOLVED.

wiper CLOSED

This fix is available in 2.5.0 (trunk) r52196.

Generated at Sat Apr 20 14:24:41 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.