cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Workload CPU and memory measures do not match percentages

manolan
Visitor

I am a novice. I'm sure the following problem arises from me not understanding the model, but I am not sure how to bridge the gap! Since the data I am looking at started from pre-defined measures, I would expect them to be consistent.

If I start from a container workload, open the CPU panel (with the basic CPU measures showing) in data explorer and then export the data, what I export does not match what I get when I export the percentage of limit.

There is one pod running 2 containers.

DateCPU usage
mCores
CPU throttling
mCores
CPU limits
mCores
CPU usage, % of limitusage/limit (calculated)
23/10/2024 16:5813.512.56003.57%2.25%
23/10/2024 16:5912.10.8926003.01%2.02%
23/10/2024 17:00395176060084.41%65.83%
23/10/2024 17:01430123060092.54%71.67%
23/10/2024 17:0234767660076.70%57.83%

 

where:
usage = 
builtin:containers.cpu.usageMilliCores:filter(in("dt.entity.container_group_instance",entitySelector("type(CONTAINER_GROUP_INSTANCE),fromRelationships.IS_CGI_OF_CA(type(CLOUD_APPLICATION),entityId(CLOUD_APPLICATION-XXX))"))):parents:parents:splitBy("dt.entity.cloud_application"):sum

throttling =
builtin:containers.cpu.throttledMilliCores:filter(in("dt.entity.container_group_instance",entitySelector("type(CONTAINER_GROUP_INSTANCE),fromRelationships.IS_CGI_OF_CA(type(CLOUD_APPLICATION),type(CLOUD_APPLICATION),entityId(CLOUD_APPLICATION-XXX))"))):parents:parents:splitBy("dt.entity.cloud_application"):sum

limit =
builtin:kubernetes.workload.limits_cpu:filter(eq("dt.entity.cloud_application",CLOUD_APPLICATION-XXX)):splitBy("dt.entity.cloud_application"):sum

%age usage =
builtin:containers.cpu.usagePercent:filter(in("dt.entity.container_group_instance",entitySelector("type(CONTAINER_GROUP_INSTANCE),fromRelationships.IS_CGI_OF_CA(type(CLOUD_APPLICATION),type(CLOUD_APPLICATION),entityId(CLOUD_APPLICATION-XXX))"))):parents:parents:splitBy("dt.entity.cloud_application"):sum

3 REPLIES 3

manolan
Visitor

I meant to add that I have the same problem with the memory measures, but it is probably the same knowledge gap!

p_devulapalli
Champion

Hi @manolan , you mentioned the pod contains two containers , so I guess the above metrics that you posted would be the pod level metrics (including two containers), right?

Can you please extract the same at the container level, separately for both containers inside the pod ?

Try comparing the metrics at both container (1+1) and pod level and you might find a clue.

Phani Devulapalli

@p_devulapalli I have no idea how to do that. I have tried a few things, but cannot get the different numbers to appear as series. Any hints?

Also, it is "sum" in both cases, so I would expect the raw numbers to be for all containers as well. So if that is the reason, I also need a suggestion for how to get the % usage at the pod level! 

Featured Posts