You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/managed-devops-pools/configure-scaling.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Managed DevOps Pools can be configured as stateless or stateful.
15
15
*[Stateless pools](#stateless-pools) - Provide a fresh agent for every job.
16
16
*[Stateful pools](#stateful-pools) - Allow sharing of agents between multiple jobs.
17
17
18
-
The default setting for a Managed DevOps pool is stateless (**Fresh agent every time**) but in some cases teams might want to reuse agents in order to reuse the packages or files created during the previous pipeline run. Build workload is a common scenario where teams want to preserve state and reuse agents. You can achieve stateful pools through Managed DevOps Pools while balancing it with security best practices. By default an agent can be reused for a maximum of 7 days but you can configure it to be recycled sooner.
18
+
The default setting for a Managed DevOps pool is stateless (**Fresh agent every time**) but in some cases teams might want to reuse agents in order to reuse the packages or files created during the previous pipeline run. Build workload is a common scenario where teams want to preserve state and reuse agents. You can achieve stateful pools through Managed DevOps Pools while balancing it with security best practices. By default an agent can be reused for a maximum of 7 days but you can configure it to be recycled sooner.
19
19
20
20
> [!NOTE]
21
21
> Stateless pools or use of the agent state setting **Fresh agent every time** are recommended by security experts as a defense against supply chain attacks.
@@ -24,6 +24,8 @@ The default setting for a Managed DevOps pool is stateless (**Fresh agent every
24
24
25
25
When a stateless agent is configured, a new agent is procured for each job, and is discarded after the job completes.
26
26
27
+
For the lifecycle of stateless agents and an explanation on how they are used in Azure DevOps pipelines (including potential delays in allocation), please see [below](#lifecycle-of-agents-and-potential-delays-in-allocation)
28
+
27
29
#### [Azure portal](#tab/azure-portal/)
28
30
29
31
:::image type="content" source="media/agent-performance/stateless-agent.png" alt-text="Screenshot of a stateless agent.":::
@@ -884,6 +886,21 @@ If you don't know your usage patterns and want to rely on automatic forecasting
884
886
885
887
* * *
886
888
889
+
* * *
890
+
891
+
## Lifecycle of Agents and potential delays in allocation
892
+
893
+
When using a Stateless scheme, ready agents require the Azure DevOps Task Agent to both be installed and set up in order to run an Azure DevOps pipeline. When provisioning new agents, our service will attempt to download the latest Azure DevOps VSTS Task agent offered [to the public](https://github.com/microsoft/azure-pipelines-agent/releases) in order to have it already downloaded on buffered agents. Startup, connection, and beginning the job can take anywhere from 10 seconds to a minute depending on the pool's SKU speed, image used, and networking load. Additionally, certain settings in an Azure DevOps's job can cause a redownload and running of a different agent, and regressions + rollbacks of the Task Agent can also cause a redownload of the agent. Ready agents will always have a potential delay, as Managed DevOps Pools uses this agent in an "ephemeral" manner, meaning we startup and run the task agent one time per job.
894
+
895
+
If you are seeing delays in ready agents picking up jobs from Azure DevOps, the following are important to consider:
896
+
897
+
* Do you have ready agents? - The most common issue is a misunderstanding of when agents should be preprovisioned. When the amount of jobs queued is greater than the buffer on a pool, or jobs are queued when the buffer is set to be empty, then machines must be spun up from scratch.
898
+
* Are you using the buffer with multiple images properly? - If you are not specifying which image to use in your pipeline using the ImageOverride demand, jobs will be targeting the first image. This means, depending on your Scaling settings, you might not have as many agents available as you'd expect as some are allocated to other images.
899
+
* Are Proxy/VNet/Firewall settings slowing down your pool? - Potential slowness from any network setting will result in agents taking longer to start the agent and connect it to Azure DevOps.
900
+
* Are you overriding the agent version? - By default, Managed DevOps pools will run on the most recent Azure DevOps task agent version. Settings in the Pipeline yaml (such as the "Agent.Version" demand) and Azure DevOps org can force pipelines to use older versions of the task agent, requiring a redownload once a machine has been allocated.
901
+
902
+
* * *
903
+
887
904
## See also
888
905
889
906
*[Configure pool settings](./configure-pool-settings.md)
0 commit comments