<p>This is similar to:
<a href="https://stackoverflow.com/questions/55023570/how-to-run-a-job-on-first-available-node/55567958">https://stackoverflow.com/questions/55023570/how-to-run-a-job-on-first-available-node/55567958</a></p>

<p>Have you considered Least Load plugin?</p>

<p><a href="https://plugins.jenkins.io/leastload" rel="nofollow noreferrer">https://plugins.jenkins.io/leastload</a></p>

<p>By default Jenkins tries to allocate a jobs to the last node is was executed on. This can result in nodes being left idle while other nodes are overloaded. This plugin overrides the default behavior and assigns jobs to nodes with the least load.</p>

<p>Don't imagine there's a security issue there.</p>

CC BY-SA 4.0
2019-04-10T07:20:47.833Z
2019-04-10T07:20:47.833Z
Ian W
<p>we currently want to introduce a loadbalancing on the Jenkins server and our nodes. I have already created several nodes.</p>

<p>Currently it is also so that if a node is blocked accordingly, that the next free option is chosen. But only if a node is issued. Unfortunately, this is only part of what the whole task looks like.</p>

<p>Task to be solved:</p>

<ul>
<li><p>If a node is under load, the next free option should be selected automatically.</p></li>
<li><p>If a node is issued, then the next inactive node should be taken.</p></li>
</ul>

<p>Problem:</p>

<p>For security reasons, you do not want us to use the loadbalancing plugin. So there has to be a solution that we have through a script or some other solution</p>

CC BY-SA 4.0
2019-04-29T19:06:33.250Z
Have you thought about using ephemeral agents to satisfy your builds?
casey vega
CC BY-SA 4.0
2020-10-22T10:39:37.347Z
@Mornon, have you had a chance to review thw advice?
Ian W
<jenkins><jenkins-pipeline><jenkins-plugins><load-balance><jenkins2>
Load Balancing of Jenkins Nodes without Load Balancing Plugin?
Mornon
# Load Balancing of Jenkins Nodes without Load Balancing Plugin?

(Asked by: username_0 on 2019-04-09)

we currently want to introduce a loadbalancing on the Jenkins server and our nodes. I have already created several nodes.

Currently it is also so that if a node is blocked accordingly, that the next free option is chosen. But only if a node is issued. Unfortunately, this is only part of what the whole task looks like.

Task to be solved:

* If a node is under load, the next free option should be selected automatically.
* If a node is issued, then the next inactive node should be taken.

Problem:

For security reasons, you do not want us to use the loadbalancing plugin. So there has to be a solution that we have through a script or some other solution

**Tags:** jenkins, jenkins-pipeline, jenkins-plugins, load-balance, jenkins2

> **Comments:**
> **username_1**: Have you thought about using ephemeral agents to satisfy your builds?  
> **username_2**: @username_0, have you had a chance to review thw advice?  

---

## 1 answers

### Answer by username_2 on 2019-04-10. Score: 1

This is similar to:
<https://stackoverflow.com/questions/55023570/how-to-run-a-job-on-first-available-node/55567958>

Have you considered Least Load plugin?

<https://plugins.jenkins.io/leastload>

By default Jenkins tries to allocate a jobs to the last node is was executed on. This can result in nodes being left idle while other nodes are overloaded. This plugin overrides the default behavior and assigns jobs to nodes with the least load.

Don't imagine there's a security issue there.


---

