I’m trying to create a pool that always starts with 1 node. After 3 minutes of having more than 70% CPU usage the pool should generate another machine, and repeat.
I’m using the current formula:
initialPoolSize = 1;
$TargetDedicatedNodes = initialPoolSize;
$totalDedicatedNodes =
(avg($CPUPercent.GetSample(TimeInterval_Minute * 3)) >= 0.7) ?
($TargetDedicatedNodes + 1) : $TargetDedicatedNodes;
I also tried using this formula that is posted in the Microsoft documentation:
initialPoolSize = 1;
$TargetDedicatedNodes = initialPoolSize;
$totalDedicatedNodes =
(min($CPUPercent.GetSample(TimeInterval_Minute * 3)) > 0.7) ?
($CurrentDedicatedNodes * 1.1) : $CurrentDedicatedNodes;
Both formulas don’t work, I’m stuck with only 1 node for the entire build time, and the CPU usage is at 100%.
If anyone has any experience with this or can help that’ll be greatly appreciated
2
Answers
This is the answer for anyone wondering
You can use the below autoscale formula to achieve your scenario.
Evaluation output:
Reference:
Autoscale compute nodes in an Azure Batch pool – Azure Batch | Microsoft Learn