qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QEMU cpu socket allocation


From: Daniel P . Berrangé
Subject: Re: QEMU cpu socket allocation
Date: Wed, 18 May 2022 09:33:57 +0100
User-agent: Mutt/2.2.1 (2022-02-19)

On Tue, May 17, 2022 at 10:50:02AM +0000, Rajesh A wrote:
> Hi QEMU dev
> 
> Virt Manager is able to configure a QEMU VM with more CPU sockets
> than the physical host has.
> For example, in the below VM, when I request 16 vCPU cores,  by
> default it takes as 16 Sockets with 1 core each. The host itself
> has only 2 Sockets.

You've told virt-manager to overcommit your CPUs.

>   1.  How does QEMU allow this and how the VM works?

It is functionally fine. A vCPU is merely OS thread, and the OS
schedular will just schedule each vCPU as it would any OS thread.

It multiple vCPUs all try to run work at the same time, then they
are going to compete with each other for running time on the physical
CPUs, and so they'll only get a subset of the time they reall want.

>   2.  What is the recommended configuration of Sockets/Cores/Threads
> for best VM performance of a 16 core VM running on a 2 sockets host ?

You've not said how many cores & threads your host CPUs have, so we
can't answer that.

The normal recommend is to not overcommit logical CPUs, where logical
CPUs means sockets * cores * threads.

VMs created by virt-manager don't use CPU pinning, so they float
freely across host CPUs as decided by the host OS scheduler. When
having floating CPUs, the CPU topology should never use threads > 1,
but the mix of cores & sockets has essentially no impact on performance.
Since each vCPU will move across different host pCPUs over time, the
effective topology is constantly changing.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]