-
Notifications
You must be signed in to change notification settings - Fork 5k
Adjust container apps to scale to zero #2440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the container app configuration documentation to reduce operational costs by lowering the default resource allocations.
- Updates the productionizing guide to include recommendations for Azure Container Apps with revised resource and scaling settings.
- Adjusts the container app resource specifications in the README to reflect a lower-cost, consumption-based plan configuration.
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
docs/productionizing.md | Adds a new section detailing recommended production settings for Azure Container Apps. |
README.md | Updates the container app configuration to a lower-cost setting by reducing CPU cores, memory, and replica counts. |
Files not reviewed (2)
- infra/core/host/container-app-upsert.bicep: Language not supported
- infra/main.bicep: Language not supported
Comments suppressed due to low confidence (2)
docs/productionizing.md:83
- There is an inconsistency between the production recommendation of keeping at least two replicas (in productionizing.md) and the default configuration in README.md (minimum of 0 replicas). Consider adding clarification to reconcile these settings.
[switching to a "Dedicated" workload profile](azure_container_apps.md#customizing-workload-profile),
README.md:87
- Ensure that the lower resource limits (0.5 CPU core, 1.0 GB RAM, minimum of 0 replicas) are appropriate for all deployment scenarios. If production environments require higher baseline performance, consider providing a note or a separate configuration option.
Azure Container Apps: Default host for app deployment as of 10/28/2024. See more details in [the ACA deployment guide](docs/azure_container_apps.md). Consumption plan with 0.5 CPU core, 1.0 GB RAM, minimum of 0 replicas. Pricing with Pay-as-You-Go. [Pricing](https://azure.microsoft.com/pricing/details/container-apps/)
Update: Our app needs more memory than the default. When deployed with these settings, we get errors like: "2025-03-19T05:09:48.9567715Z stderr F 2025-03-19 05:09:48,952 - ERROR - Worker (pid:152) was sent SIGKILL! Perhaps out of memory?" |
I've updated this so that the only change is scaling down to 0 replicas. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Maybe in the future we'll have more variables to control this
@mattgotteiner True, we have a variable for the workload profile already, so min replicas would make sense as a parameter.. if any developer reading this comments wants that as an azd env variable, please file an issue or send a PR! |
Purpose
Fixes #2436
Thanks to the filed issue, I discovered that we were configuring Container Apps with a higher-than-default CPU core and memory, and a min replica of 1.
Unfortunately, we need the higher CPU and memory, due to our app's needs,
but the app still works fine with a min replica of 0 - it just means a slower start when it needs to scale back to 1 sometimes.
Does this introduce a breaking change?
When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?
If you're not sure, try it out on an old environment.
Does this require changes to learn.microsoft.com docs?
This repository is referenced by this tutorial
which includes deployment, settings and usage instructions. If text or screenshot need to change in the tutorial,
check the box below and notify the tutorial author. A Microsoft employee can do this for you if you're an external contributor.
Type of change
Code quality checklist
See CONTRIBUTING.md for more details.
N/A, Bicep change