Why is cpu usage metric more than cpu usage percentage?

Dylan 20 Reputation points
2025-02-07T16:29:17.53+00:00

For the record, I tried asking this question here but for some reason it 404s so I'm reposting a summary of it.

I have a container app allocated 1 core and 2 GB of memory and set to 2 replicas.

When I view the cpu usage avg metric and add a filter to view only one replica, I see 0.45 cores. Because the app is allocated only 1 core, this makes me think the percentage is 45%. However when I swap the metric to see cpu usage percentage, it shows me just 33%.

What's the cause for this difference?

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

Accepted answer
  1. hossein jalilian 11,055 Reputation points Volunteer Moderator
    2025-02-07T18:18:23.0966667+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    The difference between CPU usage and CPU usage percentage in Azure Container Apps is due to how these metrics are calculated and reported.

    CPU Usage is reported in millicores, where 1000 millicores equal 1 full CPU core. When you see a CPU usage of 0.45 cores, this actually represents 450 millicores, which is indeed 45% of a single core.

    CPU Usage Percentage, on the other hand, is reported as a percentage of the CPU limit used. This metric is calculated differently and may take into account factors such as the container's CPU limit and the actual physical resources available.

    The discrepancy you're observing (45% vs 33%) could be due to several factors:

    • Measurement intervals: The two metrics might be calculated over different time periods.
    • Resource limits: The percentage might be calculated based on the total available resources across all replicas, not just the single core allocated to each replica.
    • Preview status: As the CPU Usage Percentage metric is in preview, it may still have some inconsistencies or be calculated differently from the CPU Usage metric.

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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