Azure Container Apps always running 2 replicas despite low CPU/Memory usage

parveen 65 Reputation points
2025-12-10T09:54:00.7266667+00:00

Hi everyone, I’m seeing an issue with my Azure Container App where it consistently runs 2 replicas, even though the scaling rules shouldn’t require it.

My scale settings are configured to trigger additional replicas only when CPU or Memory usage exceeds 65%, but in my case both CPU and Memory stay well below that threshold. Despite this, the app keeps running with 2 replicas and never scales down to 1.

Also i have set the Min & max replic at 1 & 5

Has anyone experienced this behavior before? Is there something I might be missing in the scaling configuration, or could another setting be forcing the second replica?

Any guidance would be greatly appreciated!

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-10T09:56:03.3033333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    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:

    1. 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.
    2. 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.
    3. 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.
    4. 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.
    5. 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:

    0 comments No comments

  2. Rakesh Mishra 3,870 Reputation points Microsoft External Staff Moderator
    2025-12-10T10:18:03.4466667+00:00

    Hey Parveen!

    It sounds like you're encountering an issue with your Azure Container App where it's persistently running 2 replicas despite being configured not to exceed 1 under low CPU and memory usage. Here’s a breakdown of what could be going wrong and some steps you can take:

    1. Check Scaling Rules: Double-check that your scaling rules are correctly set up for both CPU and memory metrics. You mentioned having set a min of 1 replica and a max of 5, so it means that there could still be conditions under which the app stays at 2 replicas. Review the exact scaling configurations for any errors or unexpected settings.
    2. Autoscaling Behavior: If you've implemented autoscaling based on CPU or memory usage exceeding 65%, ensure that your metrics reflect that those thresholds are not being crossed. You can monitor CPU and memory usage via the Azure Monitor Metrics blade:
      • Go to your Container App in Azure Portal, and under Monitoring, select “Metrics” to visualize when the replicas scale.
    3. Review Logs and Metrics: Investigate the logs during times when your application is scaling. This can give you insights into whether there are unexpected spikes in CPU or memory usage that you may have missed.
    4. Consider Memory Scaling: If there's a memory scaling rule in place, ensure it’s not set to a value that continually triggers the second replica. Since memory scaling prevents scaling down to zero, ensure your configurations align with your desired behavior.
    5. Idle and Active States: If the app remains in an active state because any previous request loads are causing it to assume traffic demand, this could also affect scaling behavior.
    6. Check for Conflicting Scale Rules: If there are multiple scale rules, they might conflict with each other. Make sure to only have the necessary rules in place.
    7. Resource Limits and Allocations: Verify resource limits for your containers to ensure they are adequate. Sometimes the configured limits can inadvertently prevent scaling actions.
    Follow-Up Questions:

    To assist you further, it would help to know:

    • What metrics exactly are being monitored for scaling (CPU, memory, or others)?
    • Can you share specific values or timeframes for your application’s CPU and memory usage during these occasions?
    • Have there been any recent changes to the scaling rules or app configuration that might affect this behavior?
    • Are there any error messages in the logs during times when you expect the app to scale down?

    I hope this helps clarify the situation, and let me know if you have more questions!

    References:

    Let me know if you need further assistance!

    Note: This content was drafted with the help of an AI system.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.