cAdvisor Killing Your Raspberry Pi CPU – Causes and Alternatives
cAdvisor is commonly included in homelab monitoring stacks alongside Prometheus and Grafana. It collects per-container metrics (CPU, RAM, network) and feeds them to Prometheus. On a desktop or server, it works fine. On a Raspberry Pi running 15+ containers, it can be catastrophic.
The Problem
My RPi 4 load average went from 1.0 to 7.0+ after adding cAdvisor. Docker stats showed:
cadvisor 115.83% 373MiB / 384MiB
Over 100% CPU usage and near its memory limit. The logs showed filesystem scanning operations taking 56 minutes to 1 hour:
fs: disk usage and inodes count on following dirs took 56m4s
fs: disk usage and inodes count on following dirs took 1h1m25s
Why It Happens
cAdvisor by default scans all mounted filesystems for every container, including Docker overlay filesystems. On a system with many containers, this creates enormous I/O and CPU load. The ARM architecture of the Raspberry Pi makes this even worse.
Partial Fix – Aggressive Flags
You can reduce cAdvisor’s impact with these flags:
cadvisor:
command:
- '--docker_only=true'
- '--housekeeping_interval=60s'
- '--global_housekeeping_interval=120s'
- '--store_container_labels=false'
- '--disable_metrics=advtcp,cpu,cpuLoad,disk,diskIO,hugetlb,memory_numa,network,percpu,referenced_memory,resctrl,sched,tcp,udp'
This helps, but on a loaded RPi it may still cause issues.
Better Alternative – Skip cAdvisor
For most home users, per-container CPU and RAM metrics are not critical. What matters is:
- Is the service up or down?
- Is the overall system healthy (CPU, RAM, disk)?
Node Exporter already covers system health perfectly. For service uptime monitoring, Home Assistant rest sensors can poll each service’s HTTP endpoint and alert you if something goes down.
# In Home Assistant configuration.yaml
binary_sensor:
- platform: rest
resource: http://localhost:3000/api/health
name: "Grafana"
device_class: connectivity
This gives you uptime alerting without any additional containers.
Result After Removing cAdvisor
After removing cAdvisor from my stack:
- Load average: 7.0 → 1.0
- Free RAM: increased by ~380MB
- All other services became more responsive
The Docker Monitoring dashboard (Grafana ID 11074) will show no data without cAdvisor – that is the trade-off.
Recommendation
On a Raspberry Pi 4 with more than 10 containers running:
- Skip cAdvisor
- Use Node Exporter for system metrics
- Use Home Assistant or a lightweight uptime tool for service monitoring
On a more powerful machine (x86 server, RPi 5 8GB), cAdvisor with the flags above works fine.