<div dir="ltr"><div>Hi,<br><br>I'm not libvirt expect. My guess is that some vcpu settings only apply to KVM/qemu backend. LXC is quite different from them.<br><br></div><div>If setting vcpu# is not effective for LXC container, you may need to use cgroups.<br>
</div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div><br>--<br>Thanks,<br></div>Yuanle<br></div></div>
<br><br><div class="gmail_quote">On Mon, Mar 17, 2014 at 2:32 PM, WANG Cheng D <span dir="ltr"><<a href="mailto:Cheng.d.Wang@alcatel-sbell.com.cn" target="_blank">Cheng.d.Wang@alcatel-sbell.com.cn</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="blue" vlink="purple" lang="ZH-CN">
<div>
<p class="MsoNormal"><span lang="EN-US">Dear all,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I am not clear about the ‘vcpu’ element for CPU allocation. I allocated 1 vCPU to my container, after I started the container, I ran 4 computation-intensive tasks on the container. And I found all the 4 physical core
 are 100% used (my host has 4 physical cores and no other application ran on the host except the container). That is, all available cores were used by the container. I want to know how to give a hard limitation for CPU usage of a container.<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">So I don’t understand what ‘vcpu’ setting can be used for.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I know that another CPU allocation element ‘shares’ can also be used, but this elements only give a relative quota. If new containers are started, the CPU quota for the already started containers will change.<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">Regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Cheng<u></u><u></u></span></p>
</div>
</div>

<br>_______________________________________________<br>
libvirt-users mailing list<br>
<a href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libvirt-users" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br></blockquote></div><br></div></div>