admin管理员组

文章数量:1289586

I have a simple Gunicorn/django api packaged in ACA.

I made a http scaling from 1 to 10 replicas. I make a huge workload with a locust script to create request to my ACA API.

The revision gets to 10 replicas like I expected. But then I made a new revision, changing the size of the container (more CPU and RAM). And when activating the new revision the initial scale is back to 1. So all my requests are now sent to a unique replicat and it throttle.

Why does the new revision does not keep the same number of replica of the previous revision, to avoid such gap of workload.

I have to wait 1-2 minute that the http scale kicks in and starts 9 more replicas.

I have a simple Gunicorn/django api packaged in ACA.

I made a http scaling from 1 to 10 replicas. I make a huge workload with a locust script to create request to my ACA API.

The revision gets to 10 replicas like I expected. But then I made a new revision, changing the size of the container (more CPU and RAM). And when activating the new revision the initial scale is back to 1. So all my requests are now sent to a unique replicat and it throttle.

Why does the new revision does not keep the same number of replica of the previous revision, to avoid such gap of workload.

I have to wait 1-2 minute that the http scale kicks in and starts 9 more replicas.

Share Improve this question edited 2 days ago Vinay B 2,4762 gold badges3 silver badges12 bronze badges Recognized by Microsoft Azure Collective asked Feb 20 at 11:17 BeGreenBeGreen 9531 gold badge19 silver badges53 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 1

Azure Container Apps new revision and scaling

The behavior or container apps when deploying a new revision replica count resets to 1, leading to throttling before it scales back up, which means its CPU potential reduces, effectively slowing down the application's execution.

An issue arises when each new revision starts at minReplicas, even if the previous revision scaled up. This results in throttling before autoscaling kicks in.

To avoid this, follow the steps below in scaling state

Before deploying a new revision, manually scale the new revision before shifting traffic

az containerapp scale update --name api-app --resource-group resource-group --min-replicas 10

Instead of immediately switching 100% of traffic to the new revision

az containerapp revision update -n api-app -g resource-group --traffic-weight 10

This will stop a sudden shift of all traffic to an under-scaled revision.

Now, by default, ACA scales down to minReplicas = 1 between traffic bursts.

az containerapp update --name api-app --resource-group resource-group --min-replicas 3 --max-replicas 10

This update make at least 3 replicas are always running, reducing cold starts.

Refer:

https://github/MicrosoftDocs/azure-docs/blob/main/articles/container-apps/traffic-splitting.md

https://learn.microsoft/en-us/azure/container-apps/revisions

本文标签: Azure Container Apps new revision and scalingStack Overflow