Interview Prep/Jenkins/Architecture, executors & JENKINS_HOME

How does Jenkins decide where to run a build when several nodes match?

AdvancedConceptArchitecture, executors & JENKINS_HOME
Answer

The default LoadBalancer uses consistent hashing on the job name to prefer the node the job last ran on (to reuse the workspace and caches), falling back to other matching nodes with free executors. If none are free, the item waits; cloud plugins observe the queue through NodeProvisioner and provision new nodes based on load statistics. Plugins like Least Load or Throttle Concurrent Builds change the strategy. With Kubernetes agents the hashing barely matters because every build gets a fresh pod.

All Jenkins questions Roadmap: Jenkins

More on Architecture, executors & JENKINS_HOME