[Lxc-users] Container swap usage question

Daniel Lezcano daniel.lezcano at free.fr
Tue Aug 31 13:56:50 UTC 2010


On 08/31/2010 09:30 AM, Victor Leschuk wrote:
> Hello all,
>
> I have been playing with LXC for few days and I got a question.
>
> I am using a simple container without OS and network just to launch
> applications with certain resource limits using lxc-execute.
>
> Here is a configuration:
>
> $ cat lxc-test.conf
> lxc.utsname = test
> lxc.cgroup.memory.limit_in_bytes = 40M
> lxc.cgroup.memory.swappiness = 0
>
>
> The problem is that memory.swappiness cgroup parameter doesn't affect
> container swap usage. As far as I understood, setting this parameter to 0
> should prevent container from using swap at all,

swappiness is like:

" /proc/sys/vm/swappiness
The value in this file controls how aggressively the kernel will swap 
memory pages. Higher val‐
ues increase agressiveness, lower values descrease aggressiveness. The 
default value is 60."

but related to a group of processes, allowing you to assign a "priority" 
between the containers.

I am not sure (to be tested), but:

memory.memsw.limit_in_bytes : sets memory+swap
and
memory.limit_in_bytes : sets memory only

So maybe if you assign the same values for both, that will implies swap = 0

Thanks
-- Daniel




More information about the lxc-users mailing list