Im trying to build a dashboard that shows the memory/cpu usage of pods, but the result of `kubectl t...
h
Im trying to build a dashboard that shows the memory/cpu usage of pods, but the result of
kubectl top po
gives very different result that what signoz is showing for average
k8s_pod_memory_usage
(using
bytes (SI)
as Y axis unit)
Copy code
at 10:25:09 ❯ kubectl top po
NAME                                         CPU(cores)   MEMORY(bytes)
chi-signoz-clickhouse-cluster-0-0-0          2334m        8225Mi
when comparing even
k8s_pod_memory_request_utilization
to what i see in
kubectl top po
it doesnt match
k8s_pod_memory_working_set
seems closer to what i get in
kubectl top po
but if the
kubectl top po
and
k8s_pod_memory_working_set
is correct, then
memory_request_utilization
is very wrong
s
Nothing is wrong. You just need to understand which metric represents what and what you are interested.
k8s_pod_memory_working_set
seems closer to what i get in
kubectl top po
It's because that's what the top shows. The working set memory shows both the resident memory + cache
h
That is very sparsely documented
Copy code
k8s.pod.memory_request_utilization
Pod memory utilization as a ratio of the pod's total container requests. If any container is missing a request the metric is not emitted.
ive got a request of
16000Mi
and
kubectl top po
says around
8000Mi
, but the
k8s.pod.memory_request_utilization
says
1.4
it seems
k8s.pod.memory_request_utilization
is calculated wrong
dividing
container_memory_working_set
by
k8s_container_memory_request
seems to give a better view of when the container is going over its request than
k8s_pod_memory_request_utilization
or am i wrong you think @Srikanth Chekuri
s
I am not familiar with how
k8s_pod_memory_request_utilization
is calculated so I can't judge which is a better representative metric.
h
yeah, not me either, cant really find it anywhere, even cloned the otel contrib code