Whatever software you use for your VM's - is there any advantage in setting the virtual vCPU to having less cores / threads / processors than the Host.
AFAIK if a VM is idle it isn't consuming any host resources so the best way to run it as far as I can see is to give it the resources it needs rather than try and run it in "Starvation Mode".
I assume this is true also if you run in HYPER-V . It seems (at least for me) to be quite difficult to get real dynamic details of resources a VM uses once you've sorted out RAM and I/O systems.
I've found though intuitively running VM's (at least with VMware) with the vCPU set to same number of processors / cores / threads as the Host and always assuming sufficient RAM and proper disk I/O they run better - especially when loaded quite heavily using the VM config parameters set that way rather than minimising to default vCPU options.
Any real "Geeky" opinions here =-- I'm actually quite interested in this topic if people have time.
In VBox they recommend no more than half the cores in the host, any more is flagged as an invalid setting.
Edit: That may be incorrect. They say not to set it above the number of physical cores with no hyperthreading.
Last edited by kado897; 3 Weeks Ago at 13:53.
I only know Hyper-V, so the following applies to it, but might apply to other virtualization platforms, too.
By default, a Hyper-V VM supports one virtual processor (vCPU) per host CPU core. On this main workhorse of mine, an i7 laptop with 8 cores, the maximum vCPU count on single VM is 8.
However, as each host CPU core can support 8 vCPUs, I could have 8 virtual machines running at the same time with 8 vCPU each (8 host cores * 8 supported vCPUs per host CPU core = 64), or 64 virtual machines running at the same time each with one vCPU, subject to other resources on host like amount of RAM allowing it.
A vCPU on a VM can only be used when matching thread on host CPU core is idle. This means that using the max amount of vCPUs, the VM can in fact be quite slow because its vCPUs must always wait that the thread on matching host CPU core is idle. According to my experience, the optimal host CPU core - VM vCPU ratio is 2:1, one vCPU per two host CPU cores when running multiple virtual machines at the same time. If only ever running one VM at any given time, my recommendation is to use 1:1 ratio, one vCPU per one host CPU core.
Great explanation - I've set it back to the suggested ratio. In my case though when testing the VM the Host is usually quite idle ---playing / serving music from the HOST isn't the most demanding of tasks for a machine.
Maybe it's miscommunication, but this is not correct. The total number of vCPU cores is not limited by physical CPU cores. With the latest release of Hyper-V, it is 2048 virtual processors per host. It's the same whether you have an entry level dual core Pentium processor or quad 20+ core Xeon's. Within a single virtual machine you are limited to 1:1 vCPU to real logical CPU, up to 64, but at the host the limit is 2048.
The reason to minimize the number of vCPU is that each virtual processor adds some overhead. Each vCPU consumes some memory, and running more threads than logical cores adds processing overhead.
Q: So, 4 vCPUs are not equal to 4 CPUs of host. If I assign 4 vCPUs to the VM, it certainly will not affect host?
So, can we say one vCPU is equal to one logical processor of physical host? (ex: one Quad processor = 8 logical processor)?
A: When dealing with hypervisors it is easier to think in cores and virtual processors than it is to think in cores, logical processors, and virtual processors.
In reality what really matters is cores and virtual processors. Each core very safely support 8 virtual processors. Logical processors are abstractions of time of the physical processors and really muddy the thinking as they apply to a physical machine one way and to a hypervisor in a different way.
Can you go beyond this number? Oh, yes. Very easily - and as long as you don't have CPU intensive virtual machines you can do it safely as well.
Hyper-V has, as far as I know, always supported more than 8 vCPUs per host core, but equally, that wording "very safely support" is still a good rule of thumb which I follow and recommend.
My apologies for wrong information.
I noticed that my computer is running on two cores instead of 4. https://gyazo.com/f1d7403963d19885971fbe6836470df7 My computer specs are: Asus m5a97 R2.0 Amd fx-4350 Nvidia gtx760 8gb Kingston hyperx.