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

Yonsy Solis yonsy.s.p at gmail.com
Wed Apr 29 14:24:03 UTC 2015



On Wed, Apr 29, 2015 at 8:15 AM, Serge Hallyn <serge.hallyn at ubuntu.com> 
wrote:

>>  lxc-start -n db09
>>  lxc-cgroup -n db09 memory.limit_in_bytes 512M
>>  lxc-cgroup -n db09 memory.memsw.limit_in_bytes 2G
>> 
>>  the host have 8GB RAM and 4GB swap.
>> 
>>  with htop (and top too) i can see my ram memory in the container
>>  limited to 512MB but the swap memory continue to be 4GB on this, not
>>  2GB. In any case is not critical because i like the idea to use swap
>>  memory minimal in the containers (and the host too)
> 
> Wait are you saying the swap limit reported by htop is wrong?  That
> presumably is just a lxcfs shortcoming.  Does htop get that from
> /proc/swaps?

in db09 container:

root at db09:/# cat /proc/swaps
Filename                                Type            Size    Used    
Priority
/dev/sda3                               partition       3907580 54560   
-1

in host:
flexie :: ~ » cat /proc/swaps                                          
                                                                        
                                                                      
127 ↵
Filename                                Type            Size    Used    
Priority
/dev/sda3                               partition       3907580 54560   
-1

this after settings with lxc-cgroup and setting in container config.

Yonsy Solis



More information about the lxc-users mailing list