What is a Jenkins Executor and how can I best utilize my executors


  • I’d like to understand what is a Jenkins executor, and how to best manage executors?
  • How many executors should I allocate to a build agent?
  • How many executors should I allocate to the Controller?



A Jenkins executor is one of the basic building blocks which allow a build to run on a node/agent (e.g. build server). Think of an executor as a single “process ID”, or as the basic unit of resource that Jenkins executes on your machine to run a build. Please see Jenkins Terminology for more details regarding executors, nodes/agents, as well as other foundational pieces of Jenkins.

You can find information on how to set the number of Jenkins executors for a given agent on the Remoting Best Practices page, section Number of executors.

Using Operations Center is the most efficient approach to making the most use of your available executors (and node/agent resources as well). If Shared Agents or Shared Cloud resources are defined at the parent Operations Center level, the children Master instances can scale up/down as needed to make the best use of the total resources. It is a more efficient approach to define Shared agent resources using a total allocation of 40 executors at the Operations Center level, than it is to define local agents attached to 4 master instances with each consuming 10 executors - a scenario that is much more likely to result in queued builds due to Executor Starvation.

The general rule is to avoid as much as possible processing any workload on your Controller.
We recommend setting the number of executor on the master to 0.
There are however some cases where running a workload on the Controller is needed, for instance if you wish to load a CASC bundle from an SCM.
In those cases, you want to make sure that you understand the implications in term of load (the Controller JVM will process the workload, therefore operations should not be heavy), and in term of security (a job running on the Controller has access to the Controller filesystem, and especially to the JENKINS_HOME).
You want to restrict the access to such a job to trusted people.
You can read more here.
You can enforce this setting from the Operations Center by going to <operations_center_url>/configureSecurity/ and ticking enforce in the Connected master on-master executors section.

Default Jenkins Behavior explains how executors function on available nodes. CloudBees Core on traditional platforms and CloudBees Jenkins Platform includes some features to help manage and make the best use of your executors, to prevent the common issue of Executor Starvation. Please see the Even Loading Strategy for more details.

Have more questions?


  • 0
    Denys Digtiar

    The new executor is used whenever you use the `node` step. If parallel branches do not request their own nodes they should be running by the same executor.

  • 0
    Dominik Panas

    What about parallel steps? For example i have job stage1-stage2a-stage2b-stage3 where stages 2 are parallel. Do i have to make some additional executors to effectively run those prallel stages? And if so, then if i have 2 machines and each has 2 executors, how to prevent running 2 jobs on the same machine (on step1)? 

Please sign in to leave a comment.