Re: Does warden container/daemon allow swap?


Matthew Sykes <matthew.sykes@...>
 

It doesn't mean that the process *can't* swap but it does mean that when
memory usage exceeds the limit, the kernel won't swap out any pages to
avoid the oom killer.

There were some discussions about this quite a while back and some folks
expressed concerns about it in relation to existing deployments and how to
get people to update the swap size because (if I recall correctly) of how
bosh manages it.

Might be a good idea to propose a change to garden to allow diego to
specify the memory+swap limit and figure out the right way forward.

On Sun, Nov 1, 2015 at 11:28 AM, Shaozhen Ding <dsz0111(a)gmail.com> wrote:

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.
--
Matthew Sykes
matthew.sykes(a)gmail.com

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.