I have 2 Docker containers running on Centos machine
for Docker memory monitoring purpose, I have installed "cadvisor" on the machine via Docker images
when I compare "Docker stats" and "cadvisor" value then I see that cadvisor shows more memory usage than docker stats
for example, the value of memory usage in Docker stats command for one container is 520 MiB but in cadvisor value is 756 MiB
Which one is right ?
According to Docker docs:
On Linux, the Docker CLI reports memory usage by subtracting page cache usage from the total memory usage.
https://docs.docker.com/engine/reference/commandline/stats/
So, to get from cAdvisor the same value as docker stats
show, you can use the following expression:
container_memory_usage_bytes - container_memory_cache
I tried it out and got exactly the same values as docker stats
produces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With