Spread load evenly by using ‘H * * * *’ rather than ‘5 * * * *’
Solution 1
H stands for Hash
To allow periodically scheduled tasks to produce even load on the system, the symbol H (for “hash”) should be used wherever possible. 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.
Solution 2
Click on the question-mark beside your schedule specification. It says there:
To allow periodically scheduled tasks to produce even load on the system, the symbol H (for “hash”) should be used wherever possible. 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.
Solution 3
Also in the documentation worth noting is that:
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.
Related videos on Youtube
I'm busy coding
Updated on July 08, 2022Comments
-
I'm busy coding almost 2 years
When setting up how Jenkins shoul pull changes from subversion I tried checked Poll SCM and set schedule to
5 * * * *
, I get the following warningSpread load evenly by using ‘H * * * *’ rather than ‘5 * * * *’
I'm not sure what H means in this context and why I should use that.
-
Benj over 7 yearsNicely explained by @CédricJulien here too : stackoverflow.com/a/12472740/1579667
-
Alexander Mills almost 5 yearsIt should allow you set a window (no earlier than this, no later than this). If you set an exact time, it should run it at the exact time.
-
Big McLargeHuge over 4 years@AlexanderMills it does: 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.
-
Henson Fang about 4 yearsSo symbol H is like a random integer?I don't really know about the meaning of "hash",too.