The Ultimate Guide to Right-Sizing CPU & Memory for Virtual Machines

Search for a command to run...

No comments yet. Be the first to comment.
The support clock is ticking toward October 2, 2025—the official end-of-life date for vSphere 7. If you still haven’t upgraded your vCenters yet, i hope you find this blog helpful in your journey. vSphere 8 also brings many features improvements such...
Struggling with burnout and constant notifications? Here is a deep dive into my productivity setup, how I manage distractions with DigitalZen

Introduction In Kubernetes, Pod Priority and Preemption is a powerful scheduling feature that ensures critical workloads are placed and maintained on your cluster, even when resources are scarce. With this mechanism, Kubernetes can automatically pree...

n8n stands out as one of the most powerful open-source low-code AI workflow automation tools available. While cloud-hosted n8n can get expensive quickly, Oracle Cloud's Always Free tier offers an incredible opportunity to run n8n completely free, for...

🧠 Why Terraform for Proxmox? While Proxmox has a great web UI, infrastructure-as-code lets you: Automate repeatable VM deployments Keep configurations under version control Easily spin up multi-VM Setups Reduce human error 👋 Quick heads-up! T...

Whether you’re just dipping your toes into Terraform or you’ve been automating your infrastructure for years, Hooking up Terraform with Proxmox is a simple step that unlocks a lot of automation power. By the end of this guide, you’ll have learned how...

In the world of virtualization, more CPU and memory doesn’t always mean better performance. Over-provisioning resources can lead to higher contention and even degraded application responsiveness.
Right-sizing ensures your workloads get exactly the resources they need—no more, no less—while maximizing efficiency on your ESXi hosts.
In this guide, we’ll explore practical CPU and memory sizing strategies, NUMA awareness, and performance optimization tips to help you make data-driven decisions.
Every ESXi host has finite CPU and memory resources. If one VM hoards them unnecessarily, other VMs suffer. The goal of right-sizing is to:
Improve overall cluster performance by reducing contention.
Optimize hardware utilization.
Avoid VM-level performance degradation caused by unnecessary over-allocation.
Reduce software licensing costs for CPU-bound products like databases.
When it comes to CPU allocation, more isn’t always better. Virtual CPUs (vCPUs) introduce scheduling overhead—allocating more than necessary can slow things down.
Start Small
Begin with the minimum number of vCPUs required for peak load.
Common starting point: 2 vCPUs for general-purpose workloads.
Add CPUs Only When Needed
Monitor for CPU Ready Time or Co-stop events.
If they are consistently high, then consider adding more vCPUs.
Align with NUMA Topology
Configure vCPUs as Cores per Socket until:
You exceed the physical core count of a NUMA node, or
You exceed the memory available in a NUMA node.
Avoid Odd vCPU Counts
Disable vCPU Hot Add Unless Necessary
Mind Licensing Models
some software licensing schemes had limitations on socket counts, configuring the socket count to 1 may result in better performance
Modern servers use NUMA (Non-Uniform Memory Access), where CPU and memory are grouped into nodes. Accessing memory within the same node is faster (local memory) than accessing from another (remote memory).
Let’s understand with an example. Lets assume:
Each physical server has 2 CPU sockets.
Each socket contains 24 physical cores.
This means one NUMA node = 1 socket = 24 cores + its own memory bank.
If you create a VM with up to 24 vCPUs, you can assign them as 1 socket × 24 cores.
If you create a VM with more than 24 vCPUs (say 32 vCPUs):
The vCPUs will be split across two NUMA nodes (because a single node can’t handle more than 24).
This means some CPU threads may need to access memory from the other node, which is slower.
At that point, you should configure vNUMA so the VM and its OS are aware of this split.
Keep vCPUs and memory allocations within a single NUMA node when possible.
vNUMA becomes relevant when a VM’s vCPUs exceed a single NUMA node’s core count (often >8 vCPUs).
vNUMA exposes NUMA topology to the guest OS so it can optimize memory locality.
Just like CPU, over-allocating RAM can harm performance due to ballooning and swapping.
Start with the Working Set
Measure actual memory use and allocate slightly above it.
Example: If a VM uses 8 GB, allocate ~10 GB.
Avoid Large Headroom
When Ballooning Occurs
Check if the VM is swapping/paging.
Right-size VMs with over-allocated RAM to free resources for others.
Right-sizing isn’t about giving VMs the most resources—it’s about giving them the right amount. By starting small, monitoring real usage, and scaling based on evidence, it will lead to boosting performance & reduce resource contention.
Awareness of physical topology and NUMA limits is also key to making the most of your hardware.