Details
-
Improvement
-
Status: Accepted
-
Major
-
Resolution: Unresolved
-
1.4.1
-
None
Description
Please add support for the functionality afforded by the --memory-swap and --memory-swappiness docker run options to the Docker Containerizer: https://github.com/apache/mesos/blob/1.4.x/src/docker/docker.hpp#L193-L194
ATM the Docker containerizer does not honor MESOS_CGROUPS_LIMIT_SWAP=true, and depending on the OS swappiness configuration, the Docker Engine will (typically) set memory.memsw.limit_in_bytes to twice the value of memory.limit_in_bytes
This means that all Docker containers can/will swap up to 2x their allocation before being OOM-killed by the Docker Engine which can cause a huge performance problem.
The only real workaround, for now, is to ensure that all apps that are launched by the Docker containerizer (at least those that are launched via Marathon) also pass --memory-swap=<memory_allocation> and/or pass --memory-swappiness=0, depending on the version of the Docker Engine, (docker run --help), as arbitrary Docker params, assuming the scheduler supports it, which is operationally cumbersome.
Ideally, the Docker containerizer would exhibit the same behavior as Mesos/UCR which sets memory.memsw.limit_in_bytes to be equal to memory.limit_in_bytes when MESOS_CGROUPS_LIMIT_SWAP=true
Ref: https://docs.docker.com/engine/admin/resource_constraints/#prevent-a-container-from-using-swap