Broadcom ESXi for the little ones. Part 1. Providing processors to virtual machines

1010184) for a VM you can configure the number of CPUs and Cores per Socket. It may seem like a tuning of sockets and cores, but ESXi has been trying to decouple the physical infrastructure from the VM provided internally for a long time, with varying degrees of success.

As it was before (before the release of 6.5)
“Previously” – in 2013 – this setting was called Number of virtual sockets and Number of cores per socket and had huge implications for performance, which you can read about here – Does cores per socket Affect Performance ? . This was done, among other things, for licensing reasons.

How it is now (6.5 and after)

By 2016 and version 6.5, the situation in the interface and logic had changed – it became possible to configure the CPU and Cores per Socket, and, dividing the first by the second, get the number of sockets, as the same author (Mark Achtemichuk) writes in the article Virtual Machine vCPU and vNUMA Rightsizing – Guidelines. Why is that? Because, starting with version 6.5, the behavior of NUMA allocation has changed, which is what the author writes about,

Essentially, the vNUMA presentation under vSphere 6.5 is no longer controlled by the Cores per Socket value. vSphere will now always present the optimal vNUMA topology unless you use advanced settings.

Referring to the well-known Frank Denneman

How does it work
In short, and not very correctly, you cannot, and should not “just like that,” manually, manage the distribution of VMs among physical processors. In general cases, which are 80-90%, start with 1-2 CPUs and 1 cores per socket per VM. An exception is if the manufacturer of the software that will work inside a virtual machine writes “as it should be correctly” or you have a set of ready-made tests to test hypotheses “what is best” – because some software (MS SQL Server for example) tries to optimize itself for execution environment. Or, if your management at the top knows exactly how to do it and wants all the processors at once.
A huge part of programs cannot handle multi-threaded tasks properly, so allocating “more cores” is often harmful. Why?
Because the fewer cores you have allocated to a virtual machine, the easier it is for the scheduler to find free timeslots on several cores to synchronously execute tasks sent to the CPU resource scheduler.
But, if you suddenly have the task of “guaranteed not to use HT”, read the short notes and links from them again:
Slow virtualization on x86. A little attempt to figure it out. Part 1: General overview
Slow virtualization on x86. A little attempt to figure it out. Part 2: ESXi by Broadcom

And sections:

Enabling this option will result in the vSphere UI reporting only a single logical processor per physical core; halving the number of logical processors if Hyperthreading was previously enabled. In addition Hyperthreading may be reported as 'Disabled' in various configuration tabs.

From the article VMware response to 'L1 Terminal Fault – VMM' (L1TF – VMM) Speculative-Execution vulnerability in Intel processors for vSphere: CVE-2018-3646 (55806)

Logical processors on the same core have consecutive CPU numbers, so that CPUs 0 and 1 are on the first core together, CPUs 2 and 3 are on the second core, and so on. Virtual machines are preferentially scheduled on two different cores rather than on two logical processors on the same core.

From the VMware vSphere section / vSphere Resource Management – Hyperthreading and ESXi Hosts Along with the theme Set Hyper Threading on ESXi

What else to read on the topic
Setting the Number of VMware CPU Cores Per Socket: Best Practices

Other related notes
Slow virtualization on x86. A little attempt to figure it out Part 4. KVM
Slow virtualization on x86. A little attempt to figure it out. Part 3: Hyper-V
Slow virtualization on x86. A little attempt to figure it out. Part 2: ESXi by
Slow virtualization on x86. A little attempt to figure it out. Part 1: General overview
Upfront wrong answers – 2 or wrong answers that many people want to hear in a technical interview: Networking (in ESXi)

PS. In the comments to the last article, which (suddenly for me, I didn’t want to) caused a flurry of pluses – they asked the question “What is the purpose of the article?” (a ton of defrosted copy also surfaced there, but discussing it is just a waste of time, people could not find a list of aircraft \ boards five articles below).
So, exactly at this The purpose of the article is to rub your colleagues’ noses into it – “here, everything is written, why don’t you want to read it.”

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *