We are having some difficulty figuring out how to configure the auto scale rules on our Azure Container App Job to use the “accurate” calculation method vs the default when determining the number of replicas needed to process a given queue length. The problem lies in that our replicas perform long running jobs and pull an item off the queue as soon as the container spins up. (We do not leave the items in the queue in a locked state)
Each running container may run for 20 to 60 minutes given the amount tasks that need to be performed. When the scaler evaluates the queue length again (say in 1 minute) the queue may have received 2 new items but since there are already two replicas running (processing 2 previous items from 20 minutes ago) it actually thinks the two active replicas are for the 2 items currently sitting in the queue which is not the case. The “accurate” calculation method is supposed to be a simple 1 to 1. One item in the queue would spin up 1 replica without any assumption that a running replica is for an existing item in the queue.
The MS documentation here states that we should be able to take full advantage of any of the ScaledObject base KEDA scalers.
The following is an example of our current Scale Rule which looks at the queue length and works only as described above.
Could use some ideas in configuring this to be a 1 to 1 queue item to replica.
Thanks,