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

Serge Hallyn serge.hallyn at ubuntu.com
Tue Apr 28 19:59:17 UTC 2015


Quoting Yonsy Solis (yonsy.s.p at gmail.com):
> Hi.
> 
> I setup some containers (lxc 1.1.2 ubuntu-lxc-git-stable-1_1 ppa)
> and i can configure memory with memory.limit_in_bytes, but i have
> two problems:
> 
> - if i try to setup the swap memory limit with
> memory.memsw.limit_in_bytes (in config or with lxc-cgroup), don't
> work aparently, this is a minor problem now, the servers works only
> with real memory, swap is only for minimal use in general.

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.

> - if i setup the cpus with cpuset.cpus and the cores are consecutive
> (lxc-cgroup -n $container cpuset.cpus 2,3) this appear inside the
> container (/proc/cpuinfo show two cores) but, if are non-cosecutive
> (lxc-cgroup -n $container cpuset.cpus 2,6) then in /proc/cpuinfo
> only appear one core (with top/htop too) but if i do:
> 
> stress -c 8 --timeout 5s
> 
> in the container, outside in the host (with htop for example) that
> correctly the cores 2 and 6 are stressed. The failure is cosmetic,
> but in the container only will report one cpu.

Interesting, that sounds like a bug in lxcfs.  Would you mind filing
an issue at github.com/lxc/lxcfs?


More information about the lxc-users mailing list