使用“ H * * * *”而不是“5 * * *”均匀分布负载

当设置詹金斯应该如何从颠覆变更 我尝试检查民意测验 SCM 和设置时间表为 5 * * * *,我得到以下警告

使用“ H * * * *”而不是“5 * * *”均匀分布负载

我不知道 H 在这里是什么意思,也不知道为什么要用它。

50958 次浏览

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.

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.

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.