[lxc-users] memory limits(lxd forkstart) in LXD

Serge Hallyn serge.hallyn at ubuntu.com
Sat Aug 8 01:05:17 UTC 2015


Yeah it looks like right now lxd interprets the number as bytes.  Try
setting it to 250000000.  Or perhaps '250M' might work.

Quoting Luis M. Ibarra (michael.ibarra at gmail.com):
> Here's part of the log file
> $sudo cat /var/log/lxd/lab1/lxc.log
>  lxc_container 1438976958.115 DEBUG    lxc_start -
> start.c:setup_signal_fd:259 - sigchild handler set
>   lxc_container 1438976958.115 DEBUG    lxc_console -
> console.c:lxc_console_peer_default:536 - no console peer
>   lxc_container 1438976958.115 INFO     lxc_start - start.c:lxc_init:451 -
> 'lab1' is initialized
>   lxc_container 1438976958.115 DEBUG    lxc_start -
> start.c:__lxc_start:1137 - Not dropping cap_sys_boot or watching utmp
>   lxc_container 1438976958.116 INFO     lxc_start -
> start.c:resolve_clone_flags:848 - Cloning a new user namespace
>   lxc_container 1438976958.118 DEBUG    lxc_conf -
> conf.c:instantiate_veth:2685 - instantiated veth 'vethK7FIGK/vethPW334Q',
> index is '18'
>   lxc_container 1438976958.118 INFO     lxc_cgroup -
> cgroup.c:cgroup_init:65 - cgroup driver cgmanager initing for lab1
>   lxc_container 1438976958.120 INFO     lxc_start -
> start.c:lxc_check_inherited:221 - closed inherited fd 3
>   lxc_container 1438976958.125 DEBUG    lxc_cgmanager -
> cgmanager.c:cgm_setup_limits:1254 - cgroup 'memory.limit_in_bytes' set to
> '250'
>   lxc_container 1438976958.125 INFO     lxc_monitor -
> monitor.c:lxc_monitor_sock_name:177 - using monitor sock name
> lxc/92ea7555d42fc75c//var/lib/lxd/lxc
>   lxc_container 1438976958.126 DEBUG    lxc_cgmanager -
> cgmanager.c:cgm_setup_limits:1254 - cgroup 'memory.limit_in_bytes' set to
> '250'
>   lxc_container 1438976958.126 INFO     lxc_cgmanager -
> cgmanager.c:cgm_setup_limits:1258 - cgroup limits have been setup
>   lxc_container 1438976958.142 DEBUG    lxc_conf -
> conf.c:lxc_assign_network:3102 - move '(null)' to '1740'
>   lxc_container 1438976958.146 NOTICE   lxc_start - start.c:do_start:667 -
> switching to gid/uid 0 in new user namespace
>   lxc_container 1438976958.147 INFO     lxc_cgmanager -
> cgmanager.c:cgm_setup_limits:1258 - cgroup limits have been setup
>   lxc_container 1438976958.147 ERROR    lxc_sync - sync.c:__sync_wake:62 -
> sync wake failure : Broken pipe
>   lxc_container 1438976958.148 ERROR    lxc_start -
> start.c:__lxc_start:1164 - failed to spawn 'lab1'
>   lxc_container 1438976958.148 WARN     lxc_commands -
> commands.c:lxc_cmd_rsp_recv:172 - command get_init_pid failed to receive
> response
>   lxc_container 1438976958.149 WARN     lxc_cgmanager -
> cgmanager.c:cgm_get:963 - do_cgm_get exited with error
> 
> 
> 
> 2015-08-07 14:41 GMT-05:00 Luis M. Ibarra <michael.ibarra at gmail.com>:
> 
> > Hi everyone,
> >
> > According to the configuration specs for memory limits I only have to add:
> > lxc profile set [profile] [key] [value]
> >
> > well, I have a container inside a kvm vm with 1gb RAM,  I want to limit
> > the container memory to 250MB. So I did:
> >
> > $lxc profile set default limits.memory 250
> > $lxc profile apply lab1 default
> >
> > however, when I ran the container I got:
> >
> > $ lxc start lab1 --debug
> > 2015/08/07 14:38:50 fingering the daemon
> > 2015/08/07 14:38:50 raw response:
> > {"type":"sync","status":"Success","status_code":200,"metadata":{"api_compat":1,"auth":"trusted","config":{},"environment":{"backing_fs":"ext4","driver":"lxc","kernel_version":"3.19.0-25-generic","lxc_version":"1.1.2","lxd_version":"0.13"}}}
> > 2015/08/07 14:38:50 pong received
> > 2015/08/07 14:38:50 putting {"action":"start","force":false,"timeout":-1}
> >  to http://unix.socket/1.0/containers/lab1/state
> > 2015/08/07 14:38:50 raw response:
> > {"type":"async","status":"OK","status_code":100,"operation":"/1.0/operations/30c96f4c-a114-4a9d-8598-43714fcbee90","resources":null,"metadata":null}
> > 2015/08/07 14:38:50
> > 1.0/operations/30c96f4c-a114-4a9d-8598-43714fcbee90/wait
> > 2015/08/07 14:38:55 raw response:
> > {"type":"sync","status":"Success","status_code":200,"metadata":{"created_at":"2015-08-07T14:38:50.066285022-05:00","updated_at":"2015-08-07T14:38:55.144230833-05:00","status":"Failure","status_code":400,"resources":null,"metadata":"Error
> > calling 'lxd forkstart': exit status 1","may_cancel":false}}
> > 2015/08/07 14:38:55 Error caught in main: *errors.errorString
> > error: Error calling 'lxd forkstart': exit status 1
> >
> >
> > So any ideas about lxd forkstart?
> >
> >
> > --
> > Luis M. Ibarra
> >
> 
> 
> 
> -- 
> Luis M. Ibarra

> _______________________________________________
> 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