2
votes

In a previous question I asked how to only let a heavy job run if two of two executors are available. This assures, that fast builds always have an executor not being blocked by a heavy one.

Fast jobs are below 10 minutes, heavies can take hours.

It the next level I look at Jenkins build clusters. Imagine one master and n build slaves with each m executors in a giant build environment. Short: A random big number of executors.

How can I assure that at least x% of the executors are available for fast jobs? If x% is less than 1 executor (e.g. 10% of 4 executors), 1 executor shall be available.

3
Can't you just have separate slaves for fast and heavy jobs ? Disadvantage is a long inactivity of slaves for fast jobs and big load on slaves for heavy jobs... - Vitalii Elenhaupt

3 Answers

3
votes

In a similar need I had, I found the best option was to use Jenkins slaves.
Put a strong slave in place to run all your heavy jobs with a single executor.
Keep all your short ones running on master.

You can also switch and put the small jobs on the slave.

IMHO, the idea of using a small server for Jenkins master and put all your builds on dedicated, strong slaves is much more scalable and manageable.

I hope this helps.

3
votes

Let us say you have 4 slave nodes with 2 executors each in total 8 executors. There are multiple ways of restricting a jenkins job from running on a slave node.

  1. You can use the default "Restrict where this project can be run" option on each Jenkins job configure section. In this way you can always have one slave node with 2 executors always dedicated for the fast jobs.
  2. Refer to this plugin https://wiki.jenkins-ci.org/display/JENKINS/Job+Restrictions+Plugin. This plugin gives you different option.

I personally prefer to dedicate a slave node for fast jobs, which gives the flexibility to increase or decrease the executors based on the hardware available. You will also have the flexibility to change the slave node to a different hardware with a minimal change in Jenkins. Say you have 1000+ jobs in Jenkins each classified as fast and heavy Jobs and have been allocated to a specific node if the number of fast jobs increases you can always easily increase the executors of the slave and hence no change in any of the individual job configuration. Hope this helps.

0
votes

The Heavy Job Plugin seems to do exactly this. I just found it a few minutes ago so do not yet have any feedback on it working or not.