Megabit Cloud
Back to Blog
Cloud Hosting
CPUVcpu

What Is a vCPU?

Megabit Cloud3 min read
What Is a vCPU?

What is a vCPU, or virtual processor, and how does it compare to a CPU? It’s the number one question that we receive from customers interested in purchasing...

What is a vCPU, or virtual processor, and how does it compare to a CPU? This is the most common question from customers interested in purchasing cloud servers or bare metal. Let's examine what a vCPU is, how it differs from traditional CPUs, and the mathematics behind calculating vCPU requirements.

What Is a vCPU?

vCPU stands for virtual centralized processing unit. A vCPU represents a portion or share of the underlying physical CPU that is assigned to a particular virtual machine (VM).

Key Terms to Understand

Hypervisor

A hypervisor acts as a controller—sometimes called a virtual machine monitor (VMM). It's software used to create and run virtual machines, allowing one host computer to support multiple guest VMs by virtually sharing resources such as memory and processing power.

Socket

When you see the term socket, think of hardware. A socket is an array of pins that hold a processor in place and connect the motherboard to available processing power. The number of sockets is determined by the motherboard's capacity.

Thread

A thread is a path of execution within a process. A process contains one or more threads. The primary difference between threads and processes is that threads within the same process run in shared memory space, while processes run in separate memory spaces.

The concept of parallelism divides a process into multiple threads. For example, having multiple tabs open in a browser represents different threads.

Physical Core

A physical core, also called a processing unit, exists within the CPU. A single physical core may correspond to one or more logical cores.

Logical Core

A logical core makes it possible for a single physical core to perform two or more actions simultaneously. This concept enabled hyper-threading (HTT), Intel's proprietary simultaneous multithreading implementation that improved parallelization of computations on x86 microprocessors.

How Does a vCPU Work?

Virtual servers and their resource allocation are controlled by hypervisors. The hypervisor uses a portion of physical CPU computing resources and allocates it to a vCPU, which is then assigned to a specific VM.

System administrators can use hypervisors to configure different resource allocations where specific VMs receive specific vCPU capabilities.

How to Calculate vCPU Requirements

vCPU count is largely determined by the manufacturer. It's calculated by taking the number of processing threads a chipset offers per core and multiplying by the number of occupied sockets:

(Threads × Cores) × Physical CPU = Number of vCPUs

Example Calculation

Using an Intel Xeon E-2288G (8 cores, 16 threads, 3.7GHz base clock, 5.0GHz turbo boost):

(16 Threads × 8 Cores) × 1 CPU = 128 vCPUs

Determine Your Workload

Before configuring, understand your workload and application profiles:

  • Do your applications run at 100% CPU utilization constantly?
  • Do they have burst periods or maintenance windows?

If you have small VMs that barely use CPU time, you could get 20-30 VMs from an 8-core server. Larger workloads like database servers will require fewer VMs from the same hardware.

Configuration Examples

  • 4 vCPUs per VM: 128 ÷ 4 = 32 VMs
  • 2 vCPUs per VM: 128 ÷ 2 = 64 VMs
  • 1 vCPU per VM: 128 ÷ 1 = 128 VMs

Avoid CPU Exhaustion

Be aware that the number of virtual cores assigned to a VM is limited. Overcommitting resources can cause CPU exhaustion and poor performance.

Need Help?

Contact us to learn more about selecting the right servers and providers for your cloud environment. We can help you determine the optimal configuration for your specific requirements.

Tags

#CPU#Vcpu

Share this article

Follow us for more updates: