0

I have the following question on how jobs are scheduled onto agents in an Agent pool.

AzDO Job Scheduling on Agents

This pertains to HOW the AzDO pipeline decides to pick which of the agents from the pool to run jobs. The expectation is that jobs will be evenly distributed across the agents in the pool. However, we are noticing that only one of the agents is repeatedly the target of job executions, and this is skewing up the agent usage and rest of the agents are idling, while jobs are waiting. I examined if there are any demand/capabilities placed on the agents and there are none. Questions: -

  1. What is the algorithm or job scheduling policy used to pick the agents? Is there any default stickiness once the job starts landing in an agent, meaning once an agent is selected from a pool then subsequent jobs get sticky to the same agent?
  2. Why is only a single agent out of multiple agents in a pool getting used, while rest of agents are idling.
Girish Pillai
  • 77
  • 2
  • 9
  • Regarding the finding 1 I have noticed the same on my private agent pools on Azure DevOps. Many times the same agent is picked up for subsequent jobs although other agents are also idle. I cannot interpet this behavior. Regarding your second point, I have not noticed this and all agents on my agent pool get utilized when multiple jobs are initiated. – GeralexGR Mar 09 '22 at 08:16
  • Can your pipeline actually be running in parallel? At least in the classic pipelines there was way to limit parallelism to 1 pipeline run at a time – silent Mar 09 '22 at 19:38

1 Answers1

1

ADO does not pick an agent. The agents "ask" ADO if there is new work for them: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&tabs=browser#communication-with-azure-pipelines

You mention "jobs". I'm not sure if you mean the technical term of an ADO job. If so: Jobs belong to a stage. An entire stage will always be executed on the same agents. Subsequent stages might be running on different agents.

I assume you are not using "Capabilities"?! Otherwise that might explain the behavior that you are seeing.

silent
  • 14,494
  • 4
  • 46
  • 86
  • Thanks for your response. Sorry - I should have been clear. By jobs I meant the entire Pipeline. As I mentioned no capabilities have been set on the agents or demanded by the pipelines. So, it still does not answer why a single agent is pulling in the pipeline when multiple others are available. – Girish Pillai Mar 09 '22 at 18:55
  • @GirishPillai lets call the agent that picks the jobs A. Do other pipelines runs are queued when agent A is working? (building, releasing) ? If no, I can give a potential explanation for this behavior but I am not pretty sure of it – GeralexGR Mar 10 '22 at 08:15
  • @GeralexGR - Yes there are other pipeline runs queued when Agen A is working. In any case, please provide the explanation in case there are no queued jobs waiting. – Girish Pillai Mar 10 '22 at 15:53
  • @GirishPillai first things first, are you eligible for more than one parallel jobs? This should define how much pipelines could not the same time. You can locate this setting on Project settings -> Parallel jobs. If you are eligible only for one job at the time, that is why the rest of the agents on agent pool are idle. Then it is explained why the agent that finishes the job, will again begin the next run – GeralexGR Mar 11 '22 at 08:25