Those instructions are for LXD, not for low level LXC.

For LXC, you'd need to use the lxc.cgroup.cpuset config keys to directly
configure the cpuset cgroup.

Note that since LXC doesn't have a long running manager like LXD does,
you're going to need to do the scheduling/balancing of those containers
yourself.

On Mon, Nov 06, 2017 at 05:20:32PM -0200, Renato dos Santos wrote:
> Hi Thouraya,
> 
> You can use this after create the container:
> 
> Set the container to use any 2 CPUs on the host.
> 
>     $ lxc config set your-container limits.cpu 2
> 
> Set the container to use physical CPU 0, 3, 7, 8 and 9 on the host.
> 
>     $ lxc config set your-container limits.cpu 0,3,7-9
> 
> Set the container to use 20% of the available CPU on the host or more if
> it’s available.
> 
>     $ lxc config set your-container limits.cpu.allowance 20%
> 
> Set the container to use no more than 50% of the available CPU on the host,
> or 100ms for every 200ms of CPU time available.
> 
>     $ lxc config set your-container limits.cpu.allowance 100ms/200ms
> 
> other option, use the profile.
> 
> 
> On 06/11/2017 16:40, Thouraya TH wrote:
> > Hi all,
> > 
> > Please, how can i fix number of cores (CPU) for a container when i use
> > lxc-create or lxc-clone ?
> > 
> > Thanks a lot for help.
> > Best reagrds.
> > 
> > 
> > 
> > _______________________________________________
> > lxc-users mailing list
> > [email protected]
> > http://lists.linuxcontainers.org/listinfo/lxc-users
> 
> -- 
> Renato dos Santos
> Analista de Infraestrutura
> 
> 48 3239-2400 Pabx
> WPLEX Software Ltda.
> Rodovia SC 401, 8600 Corporate Park Bloco 5 Sala 101
> 88050-000 Santo Antônio de Lisboa, Florianópolis SC
> wplex.com.br <http://wplex.com.br>
> WPLEX

> _______________________________________________
> lxc-users mailing list
> [email protected]
> http://lists.linuxcontainers.org/listinfo/lxc-users


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

Attachment: signature.asc
Description: PGP signature

_______________________________________________
lxc-users mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-users

Reply via email to