CPU and Memory Scaling

Akarshan Sonkar 80 Reputation points
2025-10-31T05:07:20.52+00:00

Hey Team,

I have a query regarding CPU and Memory Scaling for our application on Azure container apps. I have already configured the setup to handle concurrent requests, but I now need to implement scaling based on resource utilization.

Could you please provide the steps or configuration details required to set up CPU and Memory-based scaling?
and please let me know the costing. if there is any cheaper method please let me know that too.
User's image

Azure Container Apps
Azure Container Apps

An Azure service that provides a general-purpose, serverless container platform.


1 answer

Sort by: Most helpful
  1. Marcin Policht 103.6K Reputation points MVP Volunteer Moderator
    2025-10-31T06:47:33.72+00:00

    Refer to https://learn.microsoft.com/en-us/azure/container-apps/tutorial-scaling?tabs=bash#cpu-and-memory-scaling

    Regarding cost, Azure Container Apps pricing is consumption-based, depending on:

    Active usage — vCPU and memory allocated while the app is running.

    Idle usage — when your app has no active requests but still retains minimum resources.

    Requests and executions — small per-request charge (if using event-driven scaling).

    Resource Type Price (approx.) Notes
    vCPU (active) ~$0.000024 per vCPU-second (~$0.086/hour) Billed per second of use
    -------- -------- --------
    vCPU (active) ~$0.000024 per vCPU-second (~$0.086/hour) Billed per second of use
    Memory (active) ~$0.000003 per GiB-second (~$0.011/hour) Billed per second of use
    Idle vCPU ~1/10th of active cost Only if min replicas > 0
    Idle Memory ~1/10th of active cost Same as above
    Environment surcharge ~$0.004 per vCPU per hour Applies to total environment usage

    If you're looking to minimize the cost, consider the following:

    1. Use 0 minimum replicas — scale to zero when idle → pay only when traffic arrives.
    2. Use smaller container sizes — e.g., 0.25 vCPU / 0.5 GiB instead of 1 vCPU / 2 GiB.
    3. Use Azure Functions (Consumption Plan) — for sporadic workloads, it’s cheaper since it bills only per execution time, not for reserved CPU/memory.
    4. Use Azure Kubernetes Service (AKS) with Spot Nodes — cheaper for batch or non-critical workloads but less predictable availability.
    5. Use Pre-configured autoscaling rules carefully — avoid over-provisioning; use metrics like 80% CPU instead of 50%.

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?


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.