[lxc-users] [LXD] how to add cgroup options using lxc

Stéphane Graber stgraber at ubuntu.com
Wed Mar 18 15:00:18 UTC 2015


On Wed, Mar 18, 2015 at 04:44:29PM +1000, Mark Constable wrote:
> On 18/03/15 16:04, KATOH Yasufumi wrote:
> >>How do I translate the above settings for the lxc config command so
> >>these same values end up in /var/lib/lxd/lxd.db?
> >
> >for example, (probably ^^;)
> 
> Bingo! Thank you :-)
> 
> >name: myprofile
> >config:
> >   raw.lxc: |-
> >     lxc.cgroup.memory.soft_limit_in_bytes = 256M
> >[...]
> 
> There is no way I would have figured out that "raw.lxc: |-" syntax to retain
> line breaks in the SQLite insert entry without an example...
> 
> INSERT INTO "profiles_config" VALUES(3,2,'raw.lxc','lxc.cgroup.memory.soft_limit_in_bytes = 256M
> lxc.cgroup.memory.limit_in_bytes = 512M
> lxc.cgroup.memory.memsw.limit_in_bytes = 768M
> lxc.cgroup.cpu.shares = 256
> lxc.cgroup.blkio.weight = 500
> lxc.cgroup.cpuset.cpus = 7');
> 
> 
> ~ lxc exec v1 -- bash
> bash: cannot set terminal process group (-1): Inappropriate ioctl for device
> bash: no job control in this shell
> root at v1:~# free
>              total       used       free     shared    buffers     cached
> Mem:        524288       3548     520740    1187652          0        304
> -/+ buffers/cache:       3244     521044
> Swap:     15682556     361068   15321488
> 
> root at v1:~# grep processor /proc/cpuinfo
> processor       : 0
> 
> Related question for anyone, will we ever get to see realistic Swap: values
> in the future via the free command?

Hi,

The missing swap information is covered by:

    https://github.com/lxc/lxcfs/issues/13

Patches are welcome! :)

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150318/93d4475c/attachment.sig>


More information about the lxc-users mailing list