google / lmctfy

lmctfy is the open source version of Google’s container stack, which provides Linux application containers.
Other
3.41k stars 237 forks source link

swap_limit semantics are confusing #35

Open nipun-sehrawat opened 10 years ago

nipun-sehrawat commented 10 years ago

Hello,

MemorySpec allows users to set 'swap_limit', whose value ultimately maps to memory.memsw.limit_in_bytes. This is a bit confusing as these two entities represent different things: swap_limit gives the impression that one can specify the limit of swap space available to the application, whereas memory.memsw.limit_in_bytes value is the sum of memory and swap usage.

So, if I were to create a container with 50M memory and no swap, it's config would currently look like: memory { limit: 50M swap: 50M }

whereas, the following captures the intent better: memory { limit: 50M swap: 0 }

What do folks think? I can make the required change, if this change in semantics is acceptable to the authors. We can deprecate the proto field and introduce a new one that specifies just the swap limit.

Thanks, Nipun