[lxc-users] memory.limit_in_bytes works, but not memory.memsw.limit_in_bytes and cpuset.cpus

Jäkel, Guido G.Jaekel at dnb.de
Wed Apr 29 12:10:40 UTC 2015


Dear Yonsys,

this is a known bug/feature of the controller, You can't 

* lower  memory.memsw limit_in_bytes  below  memory.limit_in_bytes 
* raise memory.limit_in_bytes above memory.memsw limit_in_bytes

Notice that the default is "infinite" (max integer). For the typical usecase to lower the limits once at start, you have to lower memory.limit_in_bytes first. But if you want to raise the limits afterwards, you have to rise memory.memsw limit_in_bytes first

As a workaround for LXC I had suggested to set the values two times (or "one and a half", i.e. retry one of them after the second, if it have failed the first time).

But in principle this shout be handled by the controller; it should auto-rise/lower the corresponding co-value in case of a clash.

greetings

Guido

>-----Original Message-----
>From: lxc-users [mailto:lxc-users-bounces at lists.linuxcontainers.org] On Behalf Of Yonsy Solis
>Sent: Tuesday, April 28, 2015 10:34 PM
>To: LXC users mailing-list
>Subject: Re: [lxc-users] memory.limit_in_bytes works, but not memory.memsw.limit_in_bytes and cpuset.cpus
>
>
>
>On Tue, Apr 28, 2015 at 2:59 PM, Serge Hallyn <serge.hallyn at ubuntu.com>
>wrote:
>
>> I suspect your kernel isn't compiled with the support for that.  You
>> can verify that by looking under /sys/fs/cgroup/memory for a
>> memory.memsw.limit_in_bytes file.  If you compile it into the kernel
>> then lxc will be able to use it
>
>GRUB have "cgroup_enable=memory swapaccount=1" and i check with:
>
>ls /sys/fs/cgroup/memory in the hosts, i have:
>
>memory.limit_in_bytes
>memory.memsw.limit_in_bytes
>
>now, with lxc-cgroup i need to set FIRST memory.limit_in_bytes before
>memory.memsw.limit_in_bytes (if i try memsw first, lxc-cgroup give me
>an error message)
>
>but i never get set the swap memory in container limited.
>
>> Interesting, that sounds like a bug in lxcfs.  Would you mind filing
>> an issue at github.com/lxc/lxcfs?
>
>done: https://github.com/lxc/lxcfs/issues/25
>
>
>Yonsy Solis
>
>
>_______________________________________________
>lxc-users mailing list
>lxc-users at lists.linuxcontainers.org
>http://lists.linuxcontainers.org/listinfo/lxc-users


More information about the lxc-users mailing list