Configuring a label throttle

First, decide on a label and assign it to all the slaves that you’d like to group together. For example, you can use the hypervisor host name as a label, and put that label on all the slaves that are the virtual machines on that host. This can be done from the slave configuration page as shown in Figure 6.2, “Set appropriate label on the slave configuration page”.

Figure 6.2. Set appropriate label on the slave configuration page

throttle enter label

Then click the newly entered label to jump to the label page as show in Figure 6.3, “Go to the labels page”.

Figure 6.3. Go to the labels page

throttle click label

Then configure this label and enter the limit as shown in Figure 6.4, “Set limit on the hypervisor”.

Figure 6.4. Set limit on the hypervisor

throttle set limit

With this setting, as you can see, the total number of concurrent builds on hypervisor1 is limited to 2, and Jenkins Enterprise will enforce this as you can see in the executor state in Figure 6.5, “Label Throttle Build plugin in action”. Two builds are already running, so the third job sits in the queue.

Figure 6.5. Label Throttle Build plugin in action

throttle usage