[lxc-users] memory.memsw.limit_in_bytes not working on ubuntu 14.04?

Florian Engelmann engelmann at d-g-c.de
Tue Feb 4 21:20:19 UTC 2014


Hi,

adding "swapaccount=1" to my kernel cmdline fixed that.

Regards,
Florian

On 2014-02-04 21:35, Flo wrote:
> Hi,
> 
> I just created a container with:
> 
> lxc-create -n test1 -t ubuntu
> 
> Checking cache download in /var/cache/lxc/trusty/rootfs-amd64 ... 
> Copy /var/cache/lxc/trusty/rootfs-amd64 to /var/lib/lxc/test1/rootfs
> ... 
> Copying rootfs to /var/lib/lxc/test1/rootfs ...
> Generating locales...
>   en_US.UTF-8... up-to-date
> Generation complete.
> Creating SSH2 RSA key; this may take some time ...
> Creating SSH2 DSA key; this may take some time ...
> Creating SSH2 ECDSA key; this may take some time ...
> invoke-rc.d: policy-rc.d denied execution of start.
> 
> Current default time zone: 'Europe/Zurich'
> Local time is now:      Tue Feb  4 21:28:10 CET 2014.
> Universal Time is now:  Tue Feb  4 20:28:10 UTC 2014.
> 
> ##
> # The default user is 'ubuntu' with password 'ubuntu'!
> # Use the 'sudo' command to run tasks as root in the container.
> ##
> 
>  added some restrictions to the config
> 
> cat <<EOF >> /var/lib/lxc/test1/config
> 
> lxc.cgroup.cpu.shares = 256
> # restrict IO weight to 1/2 (range 10-1000)
>  lxc.cgroup.blkio.weight = 500 
> # limit memory
> lxc.cgroup.memory.limit_in_bytes = 4G
> lxc.cgroup.memory.soft_limit_in_bytes = 3G
> # memory + swap limit (6G - 4G = 2G SWAP)
> lxc.cgroup.memory.memsw.limit_in_bytes = 6G
> # default 60
> lxc.cgroup.memory.swappiness = 10
> # untestet
> lxc.cgroup.memory.oom_control = 0
> EOF
> 
> and tried to start the container with:
> 
> lxc-start -d -n test1 -l debug -o /tmp/222
> 
> cat /tmp/222
>       lxc-start 1391545773.545 INFO     lxc_start_ui - using
> rcfile /var/lib/lxc/test1/config
> 
>       lxc-start 1391545773.546 WARN     lxc_log - lxc_log_init
> called with log already initialized
>       lxc-start 1391545773.551 INFO     lxc_lsm - LSM security
> driver AppArmor
>       lxc-start 1391545773.552 DEBUG    lxc_conf - allocated pty
> '/dev/pts/17' (5/6)
>       lxc-start 1391545773.552 DEBUG    lxc_conf - allocated pty
> '/dev/pts/18' (7/8)
>       lxc-start 1391545773.552 DEBUG    lxc_conf - allocated pty
> '/dev/pts/19' (9/10)
>       lxc-start 1391545773.552 DEBUG    lxc_conf - allocated pty
> '/dev/pts/20' (11/12)
>       lxc-start 1391545773.552 INFO     lxc_conf - tty's
> configured
>       lxc-start 1391545773.552 DEBUG    lxc_start - sigchild
> handler set
>       lxc-start 1391545773.552 DEBUG    lxc_console - no console
> peer
>       lxc-start 1391545773.552 INFO     lxc_start - 'test1' is
> initialized
>       lxc-start 1391545773.554 INFO     lxc_monitor - using
> monitor sock name lxc/ad055575fe28ddd5//var/lib/lxc
>       lxc-start 1391545773.559 DEBUG    lxc_start - Not dropping
> cap_sys_boot or watching utmp
> 
>       lxc-start 1391545773.568 ERROR    lxc_conf - failed to
> attach 'vethUNUBR9' to the bridge 'lxcbr0' : No such device
>       lxc-start 1391545773.591 ERROR    lxc_conf - failed to
> create netdev
>       lxc-start 1391545773.591 ERROR    lxc_start - failed to
> create the network
>       lxc-start 1391545773.591 ERROR    lxc_start - failed to
> spawn 'test1'
>       lxc-start 1391545773.591 ERROR    lxc_commands - command
> get_cgroup failed to receive response
>       lxc-start 1391545821.393 INFO     lxc_start_ui - using
> rcfile /var/lib/lxc/test1/config
>       lxc-start 1391545821.394 WARN     lxc_log - lxc_log_init
> called with log already initialized
>       lxc-start 1391545821.399 INFO     lxc_lsm - LSM security
> driver AppArmor
>       lxc-start 1391545821.400 DEBUG    lxc_conf - allocated pty
> '/dev/pts/17' (5/6)
>       lxc-start 1391545821.400 DEBUG    lxc_conf - allocated pty
> '/dev/pts/18' (7/8)
>       lxc-start 1391545821.400 DEBUG    lxc_conf - allocated pty
> '/dev/pts/19' (9/10)
>       lxc-start 1391545821.400 DEBUG    lxc_conf - allocated pty
> '/dev/pts/20' (11/12)
>       lxc-start 1391545821.400 INFO     lxc_conf - tty's
> configured
>       lxc-start 1391545821.400 DEBUG    lxc_start - sigchild
> handler set
>       lxc-start 1391545821.400 DEBUG    lxc_console - no console
> peer
>       lxc-start 1391545821.400 INFO     lxc_start - 'test1' is
> initialized
>       lxc-start 1391545821.403 INFO     lxc_monitor - using
> monitor sock name lxc/ad055575fe28ddd5//var/lib/lxc
>       lxc-start 1391545821.419 DEBUG    lxc_start - Not dropping
> cap_sys_boot or watching utmp
> 
>       lxc-start 1391545821.424 DEBUG    lxc_conf - instanciated
> veth 'vethCXBLUH/vethRFOV22', index is '72'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.deny' set to 'a'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c *:* m'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'b *:* m'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 1:3 rwm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 1:5 rwm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 5:0 rwm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 5:1 rwm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 1:8 rwm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 1:9 rwm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 5:2 rwm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 136:* rwm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 254:0 rm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 10:229 rwm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 10:200 rwm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 1:7 rwm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 10:228 rwm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'devices.allow' set to 'c 10:232 rwm'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'cpu.shares' set to '256'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'blkio.weight' set to '500'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'memory.limit_in_bytes' set to '4G'
>       lxc-start 1391545821.428 DEBUG    lxc_cgroup - cgroup
> 'memory.soft_limit_in_bytes' set to '3G'
>       lxc-start 1391545821.428 ERROR    lxc_cgroup - Error
> setting memory.memsw.limit_in_bytes to 6G for test1
> 
>       lxc-start 1391545821.428 ERROR    lxc_start - failed to
> setup the cgroup limits for 'test1'
>       lxc-start 1391545821.523 ERROR    lxc_start - failed to
> spawn 'test1'
>       lxc-start 1391545821.523 ERROR    lxc_commands - command
> get_cgroup failed to receive response
> 
> Is cgroup memory.memsw.limit_in_bytes broken in ubuntu 14.04 right
> now?
> 
> Regards,
> Flo
> _______________________________________________
> 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