Optimising pipeline concurrency
Optimize pipeline concurrency for performance and cost
Parallel jobs are the unit
Azure DevOps Services configures parallel jobs at organization level. A parallel job represents capacity for one actively running agent job. Private projects can have free or paid Microsoft-hosted capacity; billing/time limits depend on the offer rather than one universal rule.
That means the questions to ask are:
- How many jobs do we want running at once at peak?
- What is the cost of the queue when we exceed that?
Where concurrency is consumed
Each actively running agent job consumes a slot: that includes a running matrix leg or a job from another pipeline in the organization. Queued legs, individual steps, stages as containers, approval waits, and published artifacts do not independently consume parallel jobs.
strategy:
matrix:
linux:
imageName: ubuntu-latest
windows:
imageName: windows-latest
maxParallel: 2maxParallel is how a single pipeline stays a good citizen. Remember it is only valid with matrix, and that parallel and matrix are mutually exclusive.
Self-hosted changes the shape
Self-hosted scale-out has two separate limits: available agent infrastructure and the organization's self-hosted parallel-job entitlement. VM Scale Set agents are customer-managed self-hosted agents that autoscale. Managed DevOps Pools is fully managed and scales from configuration, but pricing still combines Azure DevOps self-hosted parallel jobs with the Azure services used by the pool.
The trade-off to state
More capacity can reduce queue delay or the wall-clock time of work that can run independently; it does not make every pipeline faster. Cost depends on the selected Microsoft-hosted, self-hosted, or preview GitHub-hosted billing model plus any pool infrastructure. Measure queueing, utilization, elapsed time, and actual spend.
Primary sources
- https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/az-400
- https://learn.microsoft.com/en-us/azure/devops/pipelines/licensing/concurrent-jobs
- https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/jobs-job-strategy
- https://learn.microsoft.com/en-us/azure/devops/pipelines/process/phases
- https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/github-hosted
- https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/agents
- https://learn.microsoft.com/en-us/azure/devops/managed-devops-pools/overview
- https://learn.microsoft.com/en-us/azure/devops/managed-devops-pools/migrate-from-scale-set-agents