Search code examples
dockerjenkinsjenkins-agent

I am trying to understand the purpose of 'take agent idle' feature in Jenkins


I am trying to understand if there any performance advantages of using "bring this agent online when in demand and take offline when idle" feature in Jenkins on static Jenkins docker container based slaves. I could not find much information on this topic in Jenkins user documentation

enter image description here


Solution

  • When you run agents, they run continuously and take up resources. When you select the "bring this agent online when in demand and take offline when idle" option, Jenkins scales down the agent when builds are not running and starts them back up when a new build needs to run, meaning that resources get freed up when builds are not running. So yes, there is a performance advantage because the resources can be used to do other stuff. However, if your build agent goes offline and you need to start a new build on that agent, Jenkins will first have to start that agent, which takes time. So in that case, the build will take longer.

    This option is especially useful when you are using a cloud VM as an agent. Since cloud VMs charge for every hour that the VM is running, it makes sense to shutdown the VM when a build is not running in order to reduce costs.