<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; color: #000000"><div><div style="color: #1f497d; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;" data-mce-style="color: #1f497d; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;">Is there any way that one container using core 0 only sees the amount of his own usage in the container whatever the others containers using the same core does? </div><div style="color: #1f497d; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;" data-mce-style="color: #1f497d; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;">If I have 5 containers using core 0, they all share the same core and if container number 1 use 90% of the core you can see the 4 others containbers with cpu usage at 90% </div><div style="color: #1f497d; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;" data-mce-style="color: #1f497d; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;"><br data-mce-bogus="1"></div><div style="color: #1f497d; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;" data-mce-style="color: #1f497d; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff;">Thanks</div></div><div><br></div><div data-marker="__SIG_PRE__"><div><span style="color: rgb(51, 51, 51); font-family: times new roman,new york,times,serif;" data-mce-style="color: #333333; font-family: times new roman,new york,times,serif;">Cordialement,</span><span style="color: rgb(51, 51, 51); font-family: times new roman,new york,times,serif; font-weight: bold;" data-mce-style="color: #333333; font-family: times new roman,new york,times,serif; font-weight: bold;"><span style="color: rgb(51, 51, 51); font-family: times new roman,new york,times,serif; font-weight: bold;" data-mce-style="color: #333333; font-family: times new roman,new york,times,serif; font-weight: bold;"><br></span></span></div><div>Benoit</div></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>De: </b>"Benoit GEORGELIN - Association Web4all" <benoit.georgelin@web4all.fr><br><b>À: </b>"lxc-users" <lxc-users@lists.linuxcontainers.org><br><b>Envoyé: </b>Samedi 5 Septembre 2015 22:08:54<br><b>Objet: </b>Re: [lxc-users] Limiting number of cores in a container<br></div><div><br></div><div data-marker="__QUOTED_TEXT__"><div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12.0pt; color: #1f497d;" data-mce-style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12.0pt; color: #1f497d;"><div>This limit the number of cores in a container but if you have one container using 100% of a core, every containers using the same core will have an 100% core use. </div><div>Even with shares cpu cgroups limits. </div><br><div>Is there any way that one container using core 0 only sees the amount of his own usage in the container whatever the others using the same core do? </div><div>If I.have 5 containers using core 0, they all share this core and if container 1 use 90% you can see the 4 others systems with cpu usage at 90% </div><br><div id="signature-x" style="-webkit-user-select: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12.0pt; color: #1f497d;" data-mce-style="-webkit-user-select: none; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12.0pt; color: #1f497d;"><i style="font-family: sans-serif;" data-mce-style="font-family: sans-serif;">-- envoyé depuis mon téléphone --</i></div></div><div id="quoted_header" style="clear: both;" data-mce-style="clear: both;"><br><div style="border: none; border-top: solid #E1E1E1 1.0pt; padding: 3.0pt 0cm 0cm 0cm;" data-mce-style="border: none; border-top: solid #E1E1E1 1.0pt; padding: 3.0pt 0cm 0cm 0cm;"><span style="font-size: 11.0pt; font-family: Calibri, Arial, Helvetica, sans-serif;" data-mce-style="font-size: 11.0pt; font-family: Calibri, Arial, Helvetica, sans-serif;"><b>De :</b> Stéphane Graber <stgraber@ubuntu.com> <br><b>envoyé :</b> 2015-09-05 8:46 PM <br><b>à:</b> LXC users mailing-list <br><b>Objet:</b> Re: [lxc-users] Limiting number of cores in a container<br></span></div></div><br><div id="quoted_body">On Sat, Sep 05, 2015 at 05:09:25PM -0700, Peter Steele wrote:<br>> Our application needs to limit the number of cores a container can<br>> use. With libvirt-lxc I use the command "virsh setvpus" to set the<br>> number of cores a container can use. With this command you only have<br>> to specify the number of cores assigned to the container, not a<br>> specific core number. I can't seem to find an equivalent for this<br>> with LXC. I've found the parameter lxc.cgroup.cpuset.cpus that can<br>> be set to bind a container to use a specific CPU (core?), as well as<br>> the parameter lxc.cgroup.cpu.shares that can be used to designate a<br>> number of CPU "shares" to be assigned to a container, but I'm not<br>> exactly sure how this works, especially in the case of<br>> over-committing CPU resources.<br>> <br>> Let's assume we have a system with 16 cores that will be hosting<br>> seven containers. Six of these will be limited to two cores each and<br>> one will be assigned four cores. With libvirt-lxc I can simply<br>> assign the desired CPU count to each container and let the system<br>> would decide how the CPUs are scheduled. In fact, if I had a less<br>> powerful server, say with 8 cores instead of 16, libvirt would let<br>> me over-commit the CPUs assigned to my containers, in exactly the<br>> same way one can over-commit CPUs to VMs. This is very useful in our<br>> test environment where engineers may not all have high end systems.<br>> The CentOS lscpu command accurately reflects the virtual CPU count<br>> of the container, despite how many physical CPUs are actually<br>> present on the host:<br>> <br>> # lscpu<br>> Architecture: x86_64<br>> CPU op-mode(s): 32-bit, 64-bit<br>> Byte Order: Little Endian<br>> CPU(s): 4<br>> On-line CPU(s) list: 0-3<br>> Thread(s) per core: 1<br>> Core(s) per socket: 1<br>> Socket(s): 4<br>> NUMA node(s): 1<br>> <br>> This shows a container with four virtual CPUs.<br>> <br>> We have an automation system that creates and manages our<br>> containers. Due to its pending demise, we're migrating from<br>> libvirt-lxc to "stock" LXC and I'm trying to map the various<br>> operations used in creating libvirt containers to equivalent<br>> operations for LXC containers. It's not entirely clear to me how to<br>> deal with this CPU count issue. Can anyone give me some insight on<br>> how to setup something at least approximating what we're doing with<br>> libvirt-lxc?<br>> <br>> Thanks.<br>> <br>> Peter<br><br>lxc.cgroup.cpuset.cpus = 0-3<br><br>-- <br>Stéphane Graber<br>Ubuntu developer<br>http://www.ubuntu.com<br>_______________________________________________<br>lxc-users mailing list<br>lxc-users@lists.linuxcontainers.org<br>http://lists.linuxcontainers.org/listinfo/lxc-users</div><br>_______________________________________________<br>lxc-users mailing list<br>lxc-users@lists.linuxcontainers.org<br>http://lists.linuxcontainers.org/listinfo/lxc-users<br></div></div></body></html>