google / cadvisor

Analyzes resource usage and performance characteristics of running containers.
Other
16.85k stars 2.31k forks source link

Memory Usage always zero #3469

Open devicarus opened 6 months ago

devicarus commented 6 months ago

cAdvisor is always showing 0 memory usage

HW: Raspberry Pi 5 OS: Debian 12

My docker-compose.yml:

cadvisor:
  image: gcr.io/cadvisor/cadvisor:v0.47.2
  container_name: cadvisor
  ports:
    - 8080:8080
  volumes:
    - /:/rootfs:ro
    - /var/run:/var/run:rw
    - /sys:/sys:ro
    - /var/lib/docker/:/var/lib/docker:ro
    - /dev/disk/:/dev/disk:ro
    - /etc/machine-id:/etc/machine-id:ro
  devices:
    - /dev/kmsg
  privileged: true
  restart: unless-stopped

Logs: cadvisor.log

nathan815 commented 5 months ago

Same issue on a Raspberry Pi 4 running Debian 12/Raspbian. My docker-compose is nearly the same.

docker stats is also showing 0 memory on all containers, so there appears be a more general issue with Raspbian and Docker.

image
nathan815 commented 5 months ago

Potential solution: append cgroup_memory=1 cgroup_enable=memory to /boot/cmdline.txt. I have not tried it yet as I can't restart my Pi right now.

https://github.com/stefanprodan/dockprom/issues/228#issuecomment-897086352

https://github.com/docker/for-linux/issues/1112

anorod commented 4 months ago

I tried @nathan815 fix on the file /boot/firmware/cmdline.txt of a Raspberry Pi 5 Model B Rev 1.0 running Debian GNU/Linux 12 (bookworm) aarch64 and now the memory shows around:

But seems it's doubled of the reality:

$ free -m
               total       usado       libre  compartido   búf/caché   disponible
Mem:            8052         853        6209          28        1081        7198
Inter:          2047           0        2047