It seems you're facing an issue with your Azure Container App maintaining 2 replicas despite low CPU and memory usage. Here are some factors to consider that might help resolve the situation:
- Minimum Replicas Configuration: Since you've set the minimum number of replicas to 1, the app should be able to scale down to that level. However, if the scaling rules are not being triggered correctly, it may not scale down as expected. Ensure that your scaling rules are properly defined to allow for scaling down.
- Scale Rules and Behavior: The scaling behavior is determined by the combination of limits and rules. If your app is not meeting the criteria for scaling down, it will continue to run with 2 replicas. Double-check the conditions set in your scaling rules to ensure they allow for scaling down when CPU and memory usage are below the defined thresholds.
- Idle Replicas: If your replicas are not actively processing requests but are still in memory, they might incur lower charges, but this does not affect scaling behavior. Keep this in mind when evaluating your costs.
- Event-Driven Jobs: If you have configured event-driven jobs, they might influence the scaling behavior. Make sure these jobs are not causing the app to maintain additional replicas.
- Monitoring and Metrics: It’s important to monitor the metrics that trigger scaling. Ensure that the metrics are accurately reflecting the CPU and memory usage, as discrepancies can lead to unexpected scaling behavior.
If you've reviewed these areas and the problem continues, consider reaching out to Azure support for further assistance in diagnosing the issue.
References: