Skip to content

Conversation

pamelafox
Copy link
Collaborator

@pamelafox pamelafox commented Mar 19, 2025

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.

[X] Yes - If people are running this in production with these settings, it will reduce the performance of the app. I will note in release notes. I've also added a section to productionizing guide.
[ ] No

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.

[ ] Yes
[X] No

Type of change

[X] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

Code quality checklist

See CONTRIBUTING.md for more details.

N/A, Bicep change

@pamelafox pamelafox marked this pull request as ready for review March 19, 2025 05:06
@pamelafox pamelafox requested review from 1yefuwang1 and Copilot March 19, 2025 05:06
Copy link
Contributor

@Copilot Copilot AI left a 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/)

@pamelafox pamelafox marked this pull request as draft March 19, 2025 05:09
@pamelafox
Copy link
Collaborator Author

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?"

@pamelafox pamelafox marked this pull request as ready for review March 19, 2025 16:32
@pamelafox pamelafox requested a review from mattgotteiner March 19, 2025 16:32
@pamelafox pamelafox changed the title Adjust container app parameters to reduce costs Adjust container apps to scale to zero Mar 19, 2025
@pamelafox
Copy link
Collaborator Author

I've updated this so that the only change is scaling down to 0 replicas.

Copy link
Collaborator

@mattgotteiner mattgotteiner left a 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

@pamelafox
Copy link
Collaborator Author

@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!

@pamelafox pamelafox merged commit 926b5b2 into Azure-Samples:main Mar 19, 2025
18 checks passed
@pamelafox pamelafox deleted the acacost branch March 19, 2025 23:55
@pamelafox pamelafox mentioned this pull request Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Idle app is significantly more epensive than mentioned in cost calculator
2 participants