Jenkins – Can Jenkins nodes be given priority for build jobs

Jenkins

I have a set of build jobs in jenkins that can run in any one of 3 build nodes. They are all labeled with a common label of "ubuntu_build". Each of the nodes has a number of executors thus allowing some of the builds to execute in parallel on a machine. The setup is running fine and does what it is supposed to but I would like to improve it.

The 3 build nodes have varying performance. The first is twice as fast as the second which is twice as fast as the third. (call them fast_node, regular_node, slow_node)

As I understand the scheduling strategy, the machine that was used last for a given build job will be preferred the next time around. This can sometimes lead to issues when there are not many builds going through and the jobs were last built on slow_node and thus it keeps going there even though fast_node has some executors that could work.

What I would like is a way to say that for any job coming through the queue I would like it to try to find room on fast_node, then regular_node, then finally slow_node. (ie. try to keep using the fastest executor that is available)

Is there anyway to set something like this up?

Best Answer

Based upon AltF4_ answer I looked again at the plugins and found The Scored Load Balancer Plugin. It looks like it could do even better than the Least Load Plugin. I am going to give it a try and see how it works out.