Most of our Watchers execute on a 15 minute interval. We have about 50 watches, so ideally these should execute at "balanced" times; 50 Watchers should not execute simultaneously at 00:00, 00:15, ... for example.
Does interval: 15m this mean that:
Each Watcher runs at 00:00, 00:15, 00:30, ..., 23:45. In cron-speak, */15 * * * *
Or, that they run at multiples of fifteen minutes after the watcher was created (e.g 00:17, 00:33, ...)?
If they run at */15 * * * *, is there any built-in way to spread the Watcher execution time out. equivalent to the Jenkins syntax H/15 * * * *?
the interval schedule does not give any guarantees that watch executions will be distributed, especially after a master node switch or a cluster restart (where the interval will be used, to potentially run all watches next to each other).
You could use the hourly schedule likes this and distribute the watches
"hourly" : { "minute" : [ 0, 15, 30, 45 ] }
or just use a cron expression as you mentioned. You can use the bin/watcher/croneval tool to make sure your cron expression can be parsed correctly by watcher.
I think your suggestion of using the hourly schedule to distribute watchers is a sensible workaround; I can force them to be distributed evenly when I'm generating each watcher (thankfully I do this programmatically). e.g for three watchers
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.