1

I have a daily Jenkins trigger job that sets off a bunch of CI jobs based on a cron timer. All the daily jobs are set off by this trigger job, the daily job itself doesn't do anything.

However, this causes a bit of a load on the infrastructure available when all these jobs start executing all at once. Is there any way to stagger the triggering of these next steps in the pipeline over a period of time?

1
  • What's the configuration of the triggering job? Is it a pipeline or freestyle and by what structure are the others triggered? Example code?
    – Ian W
    Jan 21 at 11:25

3 Answers 3

1

Refer to the answer here if that helps: https://stackoverflow.com/a/12472740

There is a H parameter in the cron and you can also set a range in time for the H parameter: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/resources/hudson/triggers/TimerTrigger/help-spec.jelly#L47

0

I'd take a look at throttling your concurrent builds to reduce load:

https://plugins.jenkins.io/throttle-concurrents/

2
  • Thanks for your response Casey! The tricky thing here is that we have a lot of VM capacity that we want to use, and it is only the very first part of the jobs all happening at once that causes this load (synchronizing source control). So we can handle lots of concurrent jobs, just not all of them starting at exactly the same time...
    – Sean
    Jan 19 at 23:40
  • What kind of Jenkins jobs are these?
    – casey vega
    Jan 25 at 23:12
0

This is an example of a thundering herd issue.

A common way to deal with this issue is to sleep for a random amount of time (known as "splay") at the beginning of the job. This spreads out the load over the splay period.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.