Girish Pillai
Girish Pillai

Reputation: 87

Azure DevOps Pipelines - how agents in an agent pool are selected for running jobs

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.

Upvotes: 0

Views: 1952

Answers (1)

silent
silent

Reputation: 16148

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.

Upvotes: 1

Related Questions