Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support some type of jitter or randomness to avoid many jobs starting at the same time when it does not really matter. #6

Open
norman-abramovitz opened this issue Sep 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@norman-abramovitz
Copy link
Contributor

norman-abramovitz commented Sep 26, 2024

Jenkins uses the H symbol to represent the randomness of startup times.

https://www.jenkins.io/doc/book/pipeline/syntax/#cron-syntax

The H symbol can be used with a range. For example, H H(0-7) * * * means some time 
between 12:00 AM (midnight) to 7:59 AM. You can also use step intervals with H, with or 
without ranges.

The H symbol can be thought of as a random value over a range, but it actually is a hash 
of the job name, not a random function, so that the value remains stable for any given project.

Beware that for the day of month field, short cycles such as */3 or H/3 will not work consistently 
near the end of most months, due to variable month lengths. For example, */3 will run on 
the 1st, 4th, …31st days of a long month, then again the next day of the next month. Hashes are 
always chosen in the 1-28 range, so H/3 will produce a gap between runs of between 3 and 6 days
at the end of a month. Longer cycles will also have inconsistent lengths, but the effect may 
be relatively less noticeable.
@norman-abramovitz norman-abramovitz added the enhancement New feature or request label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant