<div dir="ltr">Hi Daniel,<div><br></div><div>Thanks a lot for the quick and detailed explanation. Please see my another query below.<br></div><div><br></div><div><div>>>In normal usage, the guest vCPUs will be floating arbitrarily across any</div><div>>>host physical CPUs.  So trying to match host / guest topology is not only</div><div>>>useless, it might actually degrade your performance - eg if you give the</div><div>>>guest 1 socket, 1 core and 2 threads, but he vCPUs get scheduled on different</div><div>>>thost sockets, the guest OS will make very bad decisions.</div><div><br></div><div>The above is true, only if the the host have multiple sockets. As long as the host has single socket, there will not be any performance degradation right?</div></div><div><br></div><div><div>>>If you are willing, however, to assign dedicated host CPUs to each guest</div><div>>>CPU, then you can try to match the host + guest topology. That will improve</div><div>>>performance, since the guest CPUs will be fixed to specific host CPUs. THis</div><div>>>isn't suitable as a default config though, hence libvirt/QEMU's default</div><div>>>behaviour of using sockets for all vCPUs.</div></div><div>Will try the advanced configuration to match the guest to host. I am kind of looking for a configuration which launches qemu with "-cpu host" option.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 5 June 2017 at 21:10, Daniel P. Berrange <span dir="ltr"><<a href="mailto:berrange@redhat.com" target="_blank">berrange@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Jun 05, 2017 at 08:40:19PM +0530, girish kumar wrote:<br>
> Hi All,<br>
><br>
> I am new here, please warn me If I am not following proper etiquette of<br>
> this mailing list.<br>
><br>
> I am breaking my head, regarding why libvirt is defining multiple CPU<br>
> sockets when I increase the vCPU count. As and when I increase the vCPU<br>
> count in libvirt guest XML, it is increasing the CPU sockets in qemu<br>
> instance.<br>
><br>
> " -smp 4,sockets=4,cores=1,threads=1 " instead " -smp<br>
> 4,sockets=1,cores=4,threads=1"<br>
><br>
> Does not this lower the performance of the guest as the host and guest<br>
> architectures gets different in that case.<br>
><br>
> Also please suggest a guest configuration which will take advantage of the<br>
> host CPU architecture.<br>
<br>
</span>In normal usage, the guest vCPUs will be floating arbitrarily across any<br>
host physical CPUs.  So trying to match host / guest topology is not only<br>
useless, it might actually degrade your performance - eg if you give the<br>
guest 1 socket, 1 core and 2 threads, but he vCPUs get scheduled on different<br>
thost sockets, the guest OS will make very bad decisions.<br>
<br>
By defaulting to giving the guest only sockets, you get fixed predictable<br>
behaviour from the guest OS, as the host OS moves vCPUs threads around.<br>
<br>
If you are willing, however, to assign dedicated host CPUs to each guest<br>
CPU, then you can try to match the host + guest topology. That will improve<br>
performance, since the guest CPUs will be fixed to specific host CPUs. THis<br>
isn't suitable as a default config though, hence libvirt/QEMU's default<br>
behaviour of using sockets for all vCPUs.<br>
<br>
Regards,<br>
Daniel<br>
<span class="HOEnZb"><font color="#888888">--<br>
|: <a href="https://berrange.com" rel="noreferrer" target="_blank">https://berrange.com</a>      -o-    <a href="https://www.flickr.com/photos/dberrange" rel="noreferrer" target="_blank">https://www.flickr.com/photos/<wbr>dberrange</a> :|<br>
|: <a href="https://libvirt.org" rel="noreferrer" target="_blank">https://libvirt.org</a>         -o-            <a href="https://fstop138.berrange.com" rel="noreferrer" target="_blank">https://fstop138.berrange.com</a> :|<br>
|: <a href="https://entangle-photo.org" rel="noreferrer" target="_blank">https://entangle-photo.org</a>    -o-    <a href="https://www.instagram.com/dberrange" rel="noreferrer" target="_blank">https://www.instagram.com/<wbr>dberrange</a> :|<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,<br>Girish<br></div></div></div>
</div>