Jenkins: two slaves versus one slave two performers

Is there a difference between creating two slaves or one slave with two artists on the same Windows server?

+8
jenkins jenkins-slave
source share
3 answers

Yes, there is a difference: it is about memory consumption and the maintenance / administration effort.

  • Starting a slave in the system starts the (main) process. This process costs the (private) main memory to run and connect to the master.
  • Each executor is a subprocess of the main process.

Thus, it is obvious that launching two executors on one slave device requires less memory in total compared to running two slaves (with one executor each), since the memory consumption of the main process will be twice:

2 * Main Processes + 2 * Executors > 1 * Main Process + 2 * Executors 

In addition, administering a slave is more than just a contractor: despite the fact that the contractor has little to worry about, there are many things to configure for the slave. In addition, the capabilities of the two slave devices are the same (they work on the same OS as you said), so there is a bit of added value to assign different labels to it as well.

In short, if there are no other boundary conditions that make me do it differently, I would always prefer to run two artists on the same slave, as it is easier to administer and some memory is saved.

+7
source share

One of the advantages that immediately comes to mind to run 1 executor for a given node is to prevent conflicts between processes at the same time.

On the other hand, you can prevent work conflicts using existing Jenkins plugins, i.e. Hard work, assembly lock.

0
source share

A slave is a "machine." The Contractor is the "OS Process" in the slave.

Therefore, ideally, we always add performers - they do their job and can work in parallel, and the simple theoretical answer to your question is "2 performers per slave"

In practice, we need to add slaves in several use cases:

  1. We need more resources (more processor, more memory, more "machines")
  2. We need different settings (different OS, different hardware)
  3. We have global resources that can create conflict for performers on the same machine (a common browser for the user interface testing process)

Make a decision based on your use case.

0
source share

All Articles