-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
possibly leaking memory cgroups #421
Comments
Actually leaking them is not ideal but is not overly suprising, this is definitely the most likely resource to leak. The limited upside is that they shouldn't persist a reboot. Can we get more system info? Kernel version? |
There's been kernel issues around this in the past https://bugzilla.kernel.org/show_bug.cgi?id=12464 |
The tests where done in a VirtualBox setup by Vagrant (
On our CI-Environment we also seem to suffered from leaking cgroups. On that environment
|
This is suspiciously similar moby/moby#29638 |
Another similar issues is google/cadvisor#1581. I used a script mentioned in that ticket (inotify_watchers.sh) to output the installed watchers. It seems that after a The attached file watchers.txt shows the installed watchers after repeated cluster creations and deletions. |
this also happens using kubeadm directly: docker: 18.06.3 (cg driver = systemd) but the amount of leakage is fairly low. |
The amount of leakage increases if some components are installed in the cluster on each create/delete cluster cycle. The original measurements where taken on newly created, empty clusters. With some few components being installed on each cycle the number of leaked memory cgroups increased to ~ 30 for each cycle. |
If the new components are new containers and assuming we are hitting one of the bugs linked with docker leaking cgroups, it can make sense since the more containers the more leakages |
has anyone checked moby/moby#29638 (comment) yet? I will look into this soon but haven't gotten to it yet. |
with the cgroup memory control cap in the kernel of 65535 (USHRT_MAX) it will take a while. |
On my machine
Will investigate more later, off to a meeting 😅 Edit: I am on a newer |
looking back at #412, is it possible we're hitting inotify limits instead? I've yet to find anything in your logs that wasn't watch related
|
The inotify scripts are not working quite right for me. It's also entirely possible that we don't leak watches or groups at all, and that something else is just using up the limit when you have many clusters etc. The default inotify limits are rather low on many setups (looks like ubuntu is 8192). EDIT: it's possible to check with Every failure in that log appears to be related to setting up an inotify watch. Based on some testing with lscgroup and on moby/moby#29638 (comment) I don't think we're seeing real cgroup "leaks". |
I'm also seeing that memory groups in |
On the GKE node where the problem occurred max_user_watches is 8192. (On that node the Gitlab-CI runner places jobs/pods that in turn use kind in integration tests.) I remember that on this node
It seems to me that these numbers increase by time. I will check them regularly. Could it be that the cAdvisor that comes with kind tries to install watches on too many cgroups, in particular on cgroups that do not "belong" to the kind cluster? |
I can confirm that repeated cluster creation / deletion does NOT leak cgroups. The output of Thank you for looking into this. I think the issue has nothing to do with kind and this issue can be closed. However, I wonder how the issue can be tracked down further. Unfortunately the |
presumably GKE nodes -> COS? (they could be ubuntu, which is a different story) on COS I believe the expectation is that everything will run as containers, you can probably |
going to close this for now since it seems to not be cgroups leaking. we might need to figure out a good pattern to increase inotify watches (possibly a daemonset?), but that's a seperate issue. |
…s-sigs#421) * Disable azure cloud routes & fix azure csi drivers upgrade * Clean code * Update upgrad script to cluster-operator pre release * Fix azurefile csi driver upgrade * Remove not working code * Clean code * Scale cloud-controller-manager to 2 replicas * Fix capz * Remove untested code * Fix cloud-controller-manager procedure --------- Co-authored-by: stg <65890694+stg-0@users.noreply.github.com>
I repeatedly created and deleted kind clusters and watched the number of cgroups under /proc/cgroups (see attached file). Here is a short summary. The columns show the initial number of cgroups, and after repeatedly creating or deleting a kind cluster:
After each creation / deletion cycle the number of memory cgroups increases whereas the other cgroups stay the same. I am not sure if this is a kind specific problem or if its related to the underlying docker (client and server are version 18.06.1-ce).
cgroups.txt
The text was updated successfully, but these errors were encountered: