Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cAdvisor constantly polls cgroup data for metrics that have been disabled #2932

Closed
eero-t opened this issue Aug 30, 2021 · 3 comments · Fixed by #2940
Closed

cAdvisor constantly polls cgroup data for metrics that have been disabled #2932

eero-t opened this issue Aug 30, 2021 · 3 comments · Fixed by #2940

Comments

@eero-t
Copy link
Contributor

eero-t commented Aug 30, 2021

This is continuation on #2897 issue. After that, cAdvisor code was change to support enabling/disabling all metrics, including "cpu" & "app" ones in #2910.

Setup:

  • Ubuntu 20.04 host (= cgroup v1)
  • Few days old git head of runC & cAdvisor (and drm-tip kernel)

Use-case:

  • Start cAdvisor with only one metric enabled: cadvisor -enable_metrics hugetlb

Expected output:

  • Only the enabled metrics are queried (in this case, "hugetlb")

Actual output:

  • cAdvisor constantly queries "cpu" & "pids" cgroups

These are the opened file & dir names from 1 min of tracing:

# strace -f -e openat -p $(pidof cadvisor) 2> trace.txt
^C
# grep openat trace.txt | grep -v "openat resumed" | cut -d'"' -f2 | sed 's%^.*/%%' | sort | uniq -c | sort -nr
   2002 cpu.shares
   2002 cpu.cfs_quota_us
   2002 cpu.cfs_period_us
   1976 pids.max
    134 system.slice
...
@eero-t
Copy link
Contributor Author

eero-t commented Sep 15, 2021

@Creatone does this look as OK fix for this: eero-t@e57ee46

At least in my own testing it fixed the redundant polling.

@Creatone
Copy link
Collaborator

Creatone commented Sep 16, 2021

@eero-t Could you prepare PR :)?

@eero-t
Copy link
Contributor Author

eero-t commented Sep 16, 2021

@Creatone #2940

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants