[lxc-users] lxd limits.memory don't work in trusty instances

Yonsy Solis yonsy.s.p at gmail.com
Mon Jan 25 00:55:19 UTC 2016


Good night

I have two servers with Ubuntu 14.04.3 and LXD don't setup limits (now) 
for memory usage.

======
☁  ~  lxc launch ubuntu master
Creating master done.
Starting master done.
☁  ~  free
             total       used       free     shared    buffers     
cached
Mem:      16112676    1416092   14696584       1984     326184     
814600
-/+ buffers/cache:     275308   15837368
Swap:     16451580          0   16451580
☁  ~  lxc exec master free
             total       used       free     shared    buffers     
cached
Mem:      16112676      10604   16102072       2016          0       
2412
......
☁  ~  lxc config set master limits.memory 25%
☁  ~  lxc exec master free
             total       used       free     shared    buffers     
cached
Mem:      16112676      10484   16102192       2016          0       
2412
......
======
the same happens in another server here (with 16GB RAM too) and in my 
Laptop (Ideapad Flex 14)

now if i try in https://linuxcontainers.org/lxd/try-it/

======
root at tryit:~# lxc launch ubuntu d1
Creating d1
Starting d1
root at tryit:~# lxc exec d1 free
             total       used       free     shared    buffers     
cached
Mem:        262144     114668     147476        804          0     
106320
-/+ buffers/cache:       8348     253796
Swap:      6151872          8    6151864
root at tryit:~# lxc config set d1 limits.memory 50%
root at tryit:~# lxc exec d1 free
             total       used       free     shared    buffers     
cached
Mem:        131068     114464      16604        800          0     
106316
-/+ buffers/cache:       8148     122920
Swap:      6151872          8    6151864
root at tryit:~#
======

this works!

now, the differences are that i am using 14.04, not 15.10 like in 
try-it, but the try-it server is using 3.19 kernel (vivid based IIRC) 
and my servers and my laptop are with wily kernel, 4.2.0-25 now, the 
problem is related to kernel versions (appear in wily too ?)

my lxd packages comes from trusty-backports (now 0.26 version) and my 
related packages in servers are:

======
☁  ~  dpkg -l | grep -E 'lxd|lxc|cgmanager'
ii  cgmanager                           0.39-2ubuntu2~ubuntu14.04.1     
    amd64        Central cgroup manager daemon
ii  libcgmanager0:amd64                 0.39-2ubuntu2~ubuntu14.04.1     
    amd64        Central cgroup manager daemon (client library)
ii  liblxc1                             1.1.5-0ubuntu3~ubuntu14.04.1    
    amd64        Linux Containers userspace tools (library)
ii  lxc                                 1.1.5-0ubuntu3~ubuntu14.04.1    
    amd64        Linux Containers userspace tools
ii  lxc-templates                       1.1.5-0ubuntu3~ubuntu14.04.1    
    amd64        Linux Containers userspace tools (templates)
ii  lxcfs                               0.11-0ubuntu3~ubuntu14.04.1     
    amd64        FUSE based filesystem for LXC
ii  lxd                                 0.26-0ubuntu2~ubuntu14.04.1     
    amd64        Container hypervisor based on LXC - daemon
ii  lxd-client                          0.26-0ubuntu2~ubuntu14.04.1     
    amd64        Container hypervisor based on LXC - client
ii  lxd-tools                           0.26-0ubuntu2~ubuntu14.04.1     
    amd64        Container hypervisor based on LXC - extra tools
ii  python3-lxc                         1.1.5-0ubuntu3~ubuntu14.04.1    
    amd64        Linux Containers userspace tools (Python 3.x bindings)
☁  ~
======

latest versions from trusty-backports branch.

i am thinking that the problem can be:

1. Kernel (4.2.0-25) in this case i will need, rollback to 3.19.x 
kernels until the problem get corrected.
2. trusty-backports repository, in this case i will need, add 
lxd-stable ppa to my servers and laptop.
3. some other thing unrelated to 1 and 2.  (maybe limits.memory dont 
work with lxd 0.26, try-it is using lxd 0.20 now for example)

well, somebody can help me to resolve this issue ?

Yonsy Solis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20160124/d54b206d/attachment.html>


More information about the lxc-users mailing list