1

I created a pool in Azure Batch (from the Azure portal) with Auto scale activated.

I also defined a formula where the initial number of node is set to 0. This number will ramp up according to number of active tasks and will go back to 0 if there no task remaining.

My problem is that the minimum evaluation interval for the formula is 5 minutes, which means that in the worst case I have to wait at least 5 minutes (plus the time it takes for the nodes to boot and execute the start task) before a task can be assigned to a node.

I would like to apply the formula on the pool on demand by using the REST API (for instance right after adding a job).

According to the API documentation:

https://learn.microsoft.com/en-us/rest/api/batchservice/pool/evaluate-auto-scale

You can evaluate a formula but it will not be applied on the pool.

https://learn.microsoft.com/en-us/rest/api/batchservice/pool/enable-auto-scale

You can enable automatic scaling for a pool but if it is already enabled you have to specify a new auto scale formula and/or a new evaluation interval.

If you specify a new interval, then the existing auto scale evaluation schedule will be stopped and a new auto scale evaluation schedule will be started, with its starting time being the time when this request was issued.

wad_
  • 11
  • 1

1 Answers1

0

You can disable and then re-enable the autoscale formula, but note the call limits on the enable API. However note that if you are trying to do this frequently on the order of less than the minimum evaluation period that thrashing a pool faster than the underlying infrastructure can allocate resources does not provide any benefits.

fpark
  • 2,304
  • 2
  • 14
  • 21