Does warden container/daemon allow swap?
Shaozhen Ding
I looked into the source code of warden.
Realized that warden sets these two cgroup memory settings
https://github.com/cloudfoundry/warden/blob/76010f2ba12e41d9e8755985ec874391fb3c962a/warden/lib/warden/container/features/mem_limit.rb#L108
Both memory.limit_in_bytes and memory.memsw.limit_in_bytes are set to the same value, which means the memory and memory + swap are the exact same value.
Does this mean the processes running in warden container can not swap at all? Since before swap, the container will be killed by the OOM killer. Wonder if this is a good strategy?
BTW, looking at docker. By default, it set memory.memsw.limit_in_bytes = 2 * memory.limit_in_bytes, which gives the application process some swap room.
Realized that warden sets these two cgroup memory settings
https://github.com/cloudfoundry/warden/blob/76010f2ba12e41d9e8755985ec874391fb3c962a/warden/lib/warden/container/features/mem_limit.rb#L108
Both memory.limit_in_bytes and memory.memsw.limit_in_bytes are set to the same value, which means the memory and memory + swap are the exact same value.
Does this mean the processes running in warden container can not swap at all? Since before swap, the container will be killed by the OOM killer. Wonder if this is a good strategy?
BTW, looking at docker. By default, it set memory.memsw.limit_in_bytes = 2 * memory.limit_in_bytes, which gives the application process some swap room.