Standalone ESXi host and its resident Virtual Machines (VMs) are experiencing severe performance degradation and high latency. Because the environment lacks a vCenter for centralized resource management, the host is struggling to balance processing demands across the guests.
Symptoms include:
Extreme guest OS slowness and application "lag."High CPU Ready (%RDY) values.Increased Ideal value metrics, indicating the scheduler is not meeting the VM's demand efficiently.High latency across the entire host environment despite available physical resources.Upon verification of the VM configuration files (.vmx), it was confirmed that the parameter sched.cpu.affinity = "all" is explicitly applied to multiple VMs. This non-standard configuration forces the ESXi CPU scheduler to bypass its default optimized behavior.VMware Vsphere 8.x
It is identified as CPU Affinity Misconfiguration. Setting CPU affinity to "all" on a high-core-count host (e.g., 48-vCPU) forces the ESXi scheduler to evaluate every single physical core for every instruction cycle for every VM. This creates several technical bottlenecks:
Restriction of Native Algorithms: The scheduler can no longer use its "relaxed co-scheduling" algorithms to balance loads dynamically.
Increased CPU Ready Time: VMs are forced to wait longer for the scheduler to complete the affinity check across the entire physical socket range before execution.
High Scheduler Contention: The hypervisor consumes excessive CPU cycles managing affinity rules rather than executing actual VM instructions.
Context Switching Overhead: Significant overhead is generated as the system attempts to map virtualized requests to the full range of physical cores simultaneously.
The recommended solution is to remove the CPU affinity restrictions. This allows the ESXi hypervisor to return to its default state and manage resource distribution naturally.
Note : Need to shut down the virtual machine.
Implementation Steps:
Access the Host: Log in to the ESXi host via SSH.
Navigate to Storage: cd /vmfs/volumes/datastore
Enter VM Directory: cd <VMname>
Backup Configuration: Always create a backup before editing: cp vmname.vmx /tmp/vmname.vmx.bkp
Edit Configuration File: vi vmname.vmx
Modify Line: Locate the line sched.cpu.affinity = "all" and comment it out by adding a # at the beginning: #sched.cpu.affinity = "all"
Save and Exit: Press Esc, type :wq!, and press Enter.
Reload VM: In a standalone environment, you must unregister and re-register the VM in the inventory or restart the management agents for the changes to take effect.
The setting sched.cpu.affinity = "all" explicitly states that the virtual machine is allowed to run on all available logical processors. This is functionally identical to the default behavior when the parameter is absent from the configuration file.
Removing the affinity parameter restores the VM to the default ESXi scheduling state. The hypervisor can then dynamically migrate virtual CPU worlds across physical cores based on real-time demand and cache locality. This eliminates the artificial bottleneck, drastically reduces CPU Ready time, and restores fluid performance to both the host and the guests.
Note: If the ESXi host is managed by vCenter, there is no impact. However, if the host is standalone, performance issues will occur on the ESXi side.
Note : USE THIS KB ONLY IF THE ESXI HOST IS THE STANDALONE ESXI HOST