Skip to content

Commit 9eeab51

Browse files
Merge pull request #300807 from HyphonGuo/main
Update batch-automatic-scaling.md
2 parents 622b117 + aa59c0d commit 9eeab51

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/batch/batch-automatic-scaling.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Autoscale compute nodes in an Azure Batch pool
33
description: Enable automatic scaling on an Azure Batch cloud pool to dynamically adjust the number of compute nodes in the pool.
44
ms.topic: how-to
5-
ms.date: 04/02/2025
5+
ms.date: 06/05/2025
66
ms.custom: H1Hack27Feb2017, fasttrack-edit, devx-track-csharp
77
---
88

@@ -46,15 +46,15 @@ The following examples show two autoscale formulas, which can be adjusted to wor
4646

4747
#### Pending tasks
4848

49-
With this autoscale formula, the pool is initially created with a single VM. The `$PendingTasks` metric defines the number of tasks that are running or queued. The formula finds the average number of pending tasks in the last 180 seconds and sets the `$TargetDedicatedNodes` variable accordingly. The formula ensures that the target number of dedicated nodes never exceeds 25 VMs. As new tasks are submitted, the pool automatically grows. As tasks complete, VMs become free and the autoscaling formula shrinks the pool.
49+
With this autoscale formula, the pool is initially created with a single VM. The `$PendingTasks` metric defines the number of tasks that are running or queued. The formula finds the average number of pending tasks in the last 15 minutes and sets the `$TargetDedicatedNodes` variable accordingly. The formula ensures that the target number of dedicated nodes never exceeds 25 VMs. As new tasks are submitted, the pool automatically grows. As tasks complete, VMs become free and the autoscaling formula shrinks the pool.
5050

5151
This formula scales dedicated nodes, but can be modified to apply to scale Spot nodes as well.
5252

5353
```
5454
startingNumberOfVMs = 1;
5555
maxNumberofVMs = 25;
56-
pendingTaskSamplePercent = $PendingTasks.GetSamplePercent(180 * TimeInterval_Second);
57-
pendingTaskSamples = pendingTaskSamplePercent < 70 ? startingNumberOfVMs : avg($PendingTasks.GetSample(180 * TimeInterval_Second));
56+
pendingTaskSamplePercent = $PendingTasks.GetSamplePercent(TimeInterval_Minute * 15);
57+
pendingTaskSamples = pendingTaskSamplePercent < 70 ? startingNumberOfVMs : avg($PendingTasks.GetSample(TimeInterval_Minute * 15));
5858
$TargetDedicatedNodes=min(maxNumberofVMs, pendingTaskSamples);
5959
$NodeDeallocationOption = taskcompletion;
6060
```

0 commit comments

Comments
 (0)