113

When setting up how Jenkins shoul pull changes from subversion I tried checked Poll SCM and set schedule to 5 * * * *, I get the following warning

Spread load evenly by using ‘H * * * *’ rather than ‘5 * * * *’

I'm not sure what H means in this context and why I should use that.

alroc
  • 27,574
  • 6
  • 51
  • 97
I'm busy coding
  • 1,648
  • 4
  • 13
  • 13

3 Answers3

149

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.

SiHa
  • 7,830
  • 13
  • 34
  • 43
SMA
  • 36,381
  • 8
  • 49
  • 73
  • 2
    Nicely explained by @CédricJulien here too : http://stackoverflow.com/a/12472740/1579667 – Benj Aug 18 '16 at 14:52
  • It 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. – Alexander Mills May 28 '19 at 19:27
  • 3
    @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. – Big McLargeHuge Sep 11 '19 at 18:08
  • So symbol H is like a random integer?I don't really know about the meaning of "hash",too. – Henson Fang Feb 28 '20 at 06:29
32

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.

pitseeker
  • 2,535
  • 1
  • 27
  • 33
19

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.

Bryan Cox
  • 278
  • 2
  • 6