container_memory_usage_bytes

1,265 views
Skip to first unread message

Daniel Watrous

unread,
Jun 6, 2019, 3:02:59 PM6/6/19
to promethe...@googlegroups.com

Hello,

 

I have question about how `container_memory_usage_bytes` is calculated. Right now I see in Prometheus that a container is consuming nearly 6GB of memory

When I run docker stats for that same container on the actual node, it shows that the container is using closer to 3GB.

 

CONTAINER ID    NAME                                                                                              CPU %     MEM USAGE / LIMIT     MEM %     NET I/O    BLOCK I/O         PIDS

c6379315a3c1    k8s_jenkins_jenkins-deployment-65b57446f6-twsbn_jenkins_e6223e7d-886e-11e9-8d56-fa163e6c897e_0    59.44%    3.12GiB / 5.588GiB    55.83%    0B / 0B    138MB / 60.4kB    187

 

Why does prometheus show almost double?

 

Daniel

Chris Marchbanks

unread,
Jun 6, 2019, 3:12:08 PM6/6/19
to Daniel Watrous, promethe...@googlegroups.com
Hi Daniel,

Docker stats calculates the memory usage by subtracting cache from the total memory usage, whereas container_memory_usage_bytes includes the cache. The container_memory_rss series from cAdvisor will also exclude the cache and will be close to what docker stats produces.

Chris
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/2056A770-E6DE-4AC0-B652-2DC6DE980FCD%40trinet.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages