Speedup ECS slave provisioning / do not wait for available executor
See original GitHub issueI’ve been using this plugin for 2 years now, and I still have this issue, and it’s even been reported as ‘getting worse’ by my colleagues. I’m probably missing something here.
Let me explain.
Let’s say I have one job running, in a slave named ‘ecs-slave-1234’ provisioned by ECS plugin, based on the Label ‘slave’. (Label in the sens of ECS plugin configuration, and ‘node’ in the sense of the pipeline)
Then I trigger another job, with the same node(‘slave’)
In the job’s console I see
Waiting for next available executor on ‘ecs-slave-1234’
Then it … waits … as if it anted to reuse the provisioned one, even if it should be a disposable slave.
In jenkins logs it ends up with logs below (with origin slaves name, slightly different than in my explanation here)
Is there a way to tell Jenkins never to reuse an existing executor ?
It sometimes waits up to 3 minutes beofre deciding it sould provision something. A real pain.
I’m using Jenkins LTS 2.176.1 ECS Plugin 1.20
Thank you !
Jul 16, 2019 10:42:41 AM com.cloudbees.jenkins.plugins.amazonecs.ECSCloud provision
INFO: Asked to provision 1 agent(s) for: jenkins-slave
Jul 16, 2019 10:42:41 AM com.cloudbees.jenkins.plugins.amazonecs.ECSCloud provision
INFO: In provisioning : []
Jul 16, 2019 10:42:41 AM com.cloudbees.jenkins.plugins.amazonecs.ECSCloud provision
INFO: Excess workload after pending ECS agents: 1
Jul 16, 2019 10:42:41 AM com.cloudbees.jenkins.plugins.amazonecs.ECSCloud provision
INFO: Will provision ECS Agent jenkins-slave, for label: jenkins-slave
Jul 16, 2019 10:42:41 AM hudson.slaves.NodeProvisioner$StandardStrategyImpl apply
INFO: Started provisioning ECS Agent jenkins-slave from factory-slaves with 1 executors. Remaining excess workload: -0.289
Jul 16, 2019 10:42:51 AM hudson.slaves.NodeProvisioner$2 run
INFO: ECS Agent jenkins-slave provisioning successfully completed. We have now 3 computer(s)```
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (4 by maintainers)

Top Related StackOverflow Question
I’m currently trying these options :
-Dhudson.slaves.NodeProvisioner.MARGIN=100 -Dhudson.slaves.NodeProvisioner.MARGIN0=1.00 -Dhudson.slaves.NodeProvisioner.MARGIN_DECAY=1.00it’s over aggressive, allows “calcThresholdMargin” to always return 1 then
if (excessWorkload > 1 - m)(where m = calcThresholdMargin ) has maximum chances of being true. Let’s see if no side effects appear, but in my setup with one job = one ecs slave, should work fie enough. Else I’ll revert to the values you provide in the readme.Thank you again !
master