-
Notifications
You must be signed in to change notification settings - Fork 18.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
docker stuck when run out of host physical memory #34381
Comments
thanks for reporting, this looks to be a duplicate of #33192, and possibly #33820. Also refer to #34377 (comment) which has some additional information The TL;DR is that when the host runs out of resources, and the kernel starts to OOM kill processes, strange things can happen (e.g., the process monitoring if the container is still running is killed, in which case the docker has an "incorrect" view of the container's state). More information about limiting container resources can be found here; Limit a container's resources
Swapping is generally disabled on cloud providers (and often discouraged for production use, but YMMV). In addition, if you want to control swapping for containers, swap accounting has to be enabled in your kernel configuration, which in your example looks to not be the case (from the output of
See this section in the documentation on how to enable this You can also check your system's configuration using the I'm closing this issue because this is a duplicate, but feel free to comment after I closed |
According to docker resource constraints, I wonder |
Just setting For kernel memory (don't think it's supported on docker 17.03 yet); also read https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt |
Description
We have hundreds of containers (one per user) running on host. There's memory limit for each user/container (16G). Most of the time, most of users are not active and it's expected to be use swap memory if the physical memory runs out.
But, when it runs run out of host physical memory, the docker cannot be stopped or removed correctly.
(docker kill works OK)
Steps to reproduce the issue:
Describe the results you received:
Cannot stop container.
Describe the results you expected:
Container can be stopped correctly. And docker containers could use the swap.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: