glances icon indicating copy to clipboard operation
glances copied to clipboard

Docker memory usage is incorrect

Open Feriman22 opened this issue 2 years ago • 5 comments

Describe the bug Docker memory usage is incorrect, while comparing the glances and the docker stats command at the same time.

To Reproduce Steps to reproduce the behavior:

  1. Open Glances webUI
  2. Run the docker stats command
  3. Compare the memory usage of any docker container

Expected behavior It should be the same or very similar.

Screenshots glances

Environement (please complete the following information)

  • Operating System: Debian 12, Docker image from nicolargo/glances (latest)
  • Glances & psutil versions: v3.4.0.3
  • How do you install Glances: Docker

Feriman22 avatar Dec 31 '23 23:12 Feriman22

Glances displays the stats returned by the https://github.com/docker/docker-py library.

image

As you can see in this screenshot, the Glances value (1.55 MB is ~ to the one given by Docker-Py 1.6 MB). Do not know what is the value returned by "docker stats"...

nicolargo avatar Jan 02 '24 13:01 nicolargo

I just open an issue on the upper lib: https://github.com/docker/docker-py/issues/3210

nicolargo avatar Jan 02 '24 14:01 nicolargo

Thank you!

Feriman22 avatar Jan 02 '24 14:01 Feriman22

Have to algorithm inside Glances because Docker-Py return the stats "as it".

So the following computation will be added under the wood: usage - inactive_file.

nicolargo avatar Jan 02 '24 16:01 nicolargo

Branch 2637-docker-memory-usage-is-incorrect to be tested and merged into develop.

nicolargo avatar Jan 02 '24 17:01 nicolargo