Open flixr opened 2 years ago
Do you have still issues?
Yes. I haven't tried a newer version though... Do you expect this is fixed in a later release? Then I can try to check again... The cadvisor 0.43 binary required a newer glibc than I have on these systems, so I used 0.41. I guess I would need to try to build the latest version from source to get it running.
This is still happening as of cAdvisor 0.47.0
.
Very annoying error :(
Yes, also still having this problem with 0.47.0
I'm trying to understand the problem, so far I have tested following scenarios:
--disable_root_cgroup_stats=true
- only docker container metrics are collected, cAdvisor returns 404 on /
and /containers
, but it is expected as no root container metrics are collected, therefore there are no metrics to display.--docker_only=true
- only docker container and root container metrics are collected (looks like a bug to me). @Creatone, heads up for you, sir.Podman container was started with non-root user.
@flixr, can you rephrase you problem, please? I'm struggling with understanding it.
I want cadvisor to collect only metrics for docker containers and use as little CPU as possible. So I run it with
cadvisor --port=9338 \
--housekeeping_interval=10s \
--max_housekeeping_interval=15s \
--event_storage_event_limit=default=0 \
--event_storage_age_limit=default=0 \
--docker_only=true \
--raw_cgroup_prefix_whitelist=/docker_limit.slice/ \
--disable_root_cgroup_stats=true \
--store_container_labels=false \
--enable_metrics=cpu,cpuLoad,diskIO,memory,network,oom_event,process
Docker is running with "cgroup-parent": "docker_limit.slice"
option where I limit CPU and mem for all containers.
With --disable_root_cgroup_stats=true
as above I get:
Sep 13 12:20:21 rc-visard-ng-1421823001014 cadvisor[1407]: W0913 12:20:21.872992 1407 manager.go:694] Error getting data for container / because of race condition
Sep 13 12:20:22 rc-visard-ng-1421823001014 cadvisor[1407]: W0913 12:20:22.832694 1407 container.go:485] Failed to get RecentStats("/") while determining the next housekeeping: unable to find data in memory cache
and if I don't disable root cgroup stats, it collects - well - stats of root cgroup, so off all processes. That I don't want as it results in higher CPU usage.
Hi there! It looks like an issue has been fixed, at least in the v0.49.1 version.
I'm trying to run cAdvisor as a binary on the host (launched via systemd, not as docker container) to collect metrics of only my docker containers.
In order to get CPU usage down, I looked at #2523 and while increasing housekeeping interval helps, cAdvisor still seems to track quite a few things in the root namespace which might account for the higher CPU usage.
CAdvisor version: v0.41.0 (
v0.40.0.53+9fae30700d53a3
) Running with flags:--housekeeping_interval=10s --max_housekeeping_interval=15s --event_storage_event_limit=default=0 --event_storage_age_limit=default=0 --docker_only=true --enable_metrics=cpu,cpuLoad,diskIO,memory,network,oom_event,process --store_container_labels=false
I can still see all processes running on my host on the cAdvisor
/containers/
endpoint under Processes. These should not be visible!If I add
--disable_root_cgroup_stats=true
I get errors (similar to #2341 )The endpoint
/containers/
just showsfailed to get container "/" with error: unable to find data in memory cache
, which is a bit annoying since this is the default page, but not really a problem.Why is cAdvisor always adding a "root container"
/
which does not exist (as a container)?Validate output: