-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
1.5.10 causes memory leak in mysql container; regression from 1.4.13 #6707
Comments
I have the same issue
I implemented a temp solution using ulimit like this comment. It's worked for me. docker-library/mysql#579 (comment) |
The difference may be due to this PR: #4475 |
Yes, can confirm that this is a valid workaround. It seems very likely that the increase to infinity nofile size is the problem on some systems. |
That's .... interesting. If that's causing an issue, that feels like a bug in systemd 🤔 (as |
I will do a repro test later this week with 1.5 and 1.6, after modifying the service file, to see if the problem is isolated to just that line |
Thanks in advance for that! Slightly orthogonal; I recall I once opened a ticket (more a "reminder"); to look into other options in this area; that ticket was related to the systemd unit for docker-ce, but the same applies to the one for containerd (which was originally based on what we had in docker); docker/for-linux#73. If anyone arriving here is interested in doing some research into those options (also taking into account if they're supported on all "usual" distros), that would be welcome. |
I installed 1.5 and confirmed problem still persisted. I then modified |
I think you should do daemon-reload first and then restart containerd. And it only makes sure that it works for new containers, not for existing ones. |
I applied the same fix as @C-Higgins and it also got rid of the issue on my machine. |
Not work for me апр 11 08:40:09 tk-kv.localhost kernel: eth0: renamed from vethe040851 |
Hi, its work for me. MYSQL docker system prune -a and not work gitlab-runner -> docker -> containerd 1.5.11 yarn install debug3.local kernel: Memory cgroup out of memory: Killed process 3017931 (webpack) total-vm:38547452kB, anon-rss:3423448kB, file-rss:2896kB, shmem-rss:0kB, UID:1000 pgtables:85972kB oom_score_adj:0 |
Seems there is a bug in Systemd, if you need more than 65535 files, need to change the LimitNOFILE manually to a bigger number, such as 1048576 Maybe we need to revert this PR 4475 |
It works fine on Ubuntu 18.04.6 but it fails on Fedora 35 running same containerd and runc version go1.16.15 These commands crashes on Fedora 35 because of container use too much memory: This command works fine on Fedora 35: It works fine on Fedora 35 running mysql:5.x after setting LimitNOFILE to 1048576 in containerd.service as @kangclzjc said |
Hello. I'm experiencing the same issue. Launching mysql:8.* works great, but mysql:5.7.* causes immediate 100% memory consumption (htop), and results in the following in /var/log/messages:
Versions:
Limits:
Creating the following custom limit for containerd does not resolve the issue.
Note: Prior
This change did not resolve the issue as suggested here: #3201 |
Flushing all the docker components and reinstalling resolved the issue. (new containerd version released 22h ago)
Thanks! |
What worked for me on Fedora 36:
Then:
run again: After that it worked for me, where with the value set to unlimited, the container crashed in seconds. |
MySQL is having https://bugs.mysql.com/bug.php?id=96525. |
Just to give this topic a little push here. The change in /lib/systemd/system/containerd.service by setting the LimitNOFILE=1048576 helped! |
Having the same problem running mysql 5.5 on a Kind cluster on Fedora 36. |
I am also having the same issue on Fedora. Having to change the LimitNOFILE every time I run updates. |
I'm having the same issue on Manjaro (Kernel |
So to summarize, this seemingly helped me on Fedora 37
|
FYI this also breaks cups. |
@ThatCoffeeGuy thank you! This solved the same problem in my distro ( Manjaro linux )! |
Just a heads-up that the Possibly those changes will be part of new releases before the end of the year:
After that happens, this issue can be considered resolved? |
I suppose so. FYI: I'm not very familiar with the Linux kernel or developing Linux apps. If this is an issue of resource allocation, I suppose that would resolve it. If this is actually a memory leak or some bit of bad code, it might be worthwhile to dive into the two versions noted here and see if the code causing the issue can be identified. I ran into issues trying to revert my containerd binaries, but I might try again. |
I haven't tried to reproduce the mysql one, but it's been a problem that affected many software where outside of containers the expected limits are considerably lower. Default is 1024 soft limit. Normally it's just CPU from tasks like iterating through the limit range and closing potentially (highly unlikely) open file descriptors.
True. In some projects affected that I used, I helped track down the problem area and implement a workaround. However outside of container environments where the limits are sane and typically only raised when necessary, you're not likely to encounter this sort of problem. The bug is more to do with misconfiguration with In the meantime, you can start the container with
|
I wanted to add my own experience with this issue: apparently I can only reproduce it if swap is enabled. Starting the container with no swap (a.k.a running |
Description
I updated containerd.io on Fedora from 1.4.13 to 1.5.10. After this, all mysql docker containers across multiple projects began using 20+GB of memory where before they used <300MB. I restarted the computer and confirmed the problem persisted. I then rolled back to 1.4.13 and the problem was gone.
Steps to reproduce the issue
ENV MYSQL_VERSION=5.7.36-0ubuntu0.18.04.1
Describe the results you received and expected
No regression
What version of containerd are you using?
1.5.10
Any other relevant information
runc version 1.0.3
commit: v1.0.3-0-gf46b6ba
spec: 1.0.2-dev
go: go1.16.15
libseccomp: 2.5.3
Linux localhost.localdomain 5.16.7-200.fc35.x86_64 #1 SMP PREEMPT Sun Feb 6 19:53:54 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Show configuration if it is related to CRI plugin.
No response
The text was updated successfully, but these errors were encountered: