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

[feature request]support parameter “H” like which in Jenkins #6

Closed
iambocai opened this issue Dec 27, 2016 · 3 comments
Closed

Comments

@iambocai
Copy link

For example, using 0 0 * * * for a dozen daily jobs will cause a large spike at midnight. In contrast, using H H * * * would still execute each job once a day, but not all at the same time, better using limited resources.

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.

To allow periodically scheduled tasks to produce even load on the system, the symbol H (for “hash”) should be used wherever possible.

image

@jhuckaby
Copy link
Owner

Holy crap, this is a WONDERFUL idea. I absolutely love it. I will implement this in the next version without fail.

Thank you!!!

@jhuckaby
Copy link
Owner

jhuckaby commented Jan 6, 2017

Implemented in v0.6.4. Thanks again! https://github.com/jhuckaby/Cronicle/releases/tag/v0.6.4

@iambocai
Copy link
Author

iambocai commented May 12, 2017

Can we support steps after H?
image

It acts just like step after *, but will add a specific step size, this helps to avoid the server in the first few seconds of every minute very busy, for example:
*/5 * * * * ---> run when minute %5 == 0 && second == 0
h/5 * * * * ---> run when minute %5 == hash(job_id, 0, 5) && second == hash(job_id, 0, 60)
h * * * * ---> run when every minute && second == hash(job_id, 0, 60)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants