What 4 vCPU means
A 4 vCPU instance or virtual machine (VM) has four virtual CPUs. A vCPU is a share of a physical processor that the hypervisor assigns to the VM. On most x86 cloud servers, one vCPU is one hardware thread, so four vCPUs usually means about two physical cores with two threads each. On some processors, one vCPU is a whole physical core, so four vCPUs means four cores. Four vCPUs is therefore not always four physical cores.
What a vCPU is
A server’s hardware has several layers, and the terms are easy to confuse:
- A socket is a physical processor chip on the server’s motherboard.
- A core is an independent processing unit on that chip.
- A thread is a logical path a core can run. When simultaneous multithreading (SMT), often called hyper-threading, is enabled, one core runs two threads.
- A vCPU is what the virtual machine sees as a CPU. The hypervisor maps each vCPU onto a physical thread or core, and the guest operating system schedules its work on the vCPUs.
How vCPUs map to physical hardware
The mapping depends on the architecture and the provider:
- Intel and AMD x86 with SMT: one vCPU is usually one hardware thread. Four vCPUs are therefore about two physical cores.
- AWS Graviton (Arm): one vCPU is one physical core, with no SMT.
- Google Cloud: x86 vCPUs are hyperthreads. Arm-based types, such as Tau T2A and Axion C4A, map one vCPU to one core.
- Azure: most sizes are hyperthreaded. Some Arm-based sizes map one vCPU to one core.
Providers can change their hardware and documentation, so check the current specification of the exact instance type you plan to use.
Example sizes with 4 vCPUs
| Provider and size | vCPUs | Memory |
|---|---|---|
| AWS m5.xlarge | 4 | 16 GiB |
| AWS c5.xlarge | 4 | 8 GiB |
| Azure D4s_v5 | 4 | 16 GiB |
| Google Cloud e2-standard-4 | 4 | 16 GB |
| Google Cloud n2-standard-4 | 4 | 16 GB |
The same vCPU count can come with different amounts of memory, so compare the whole specification, not the vCPU number alone.
Does more vCPU mean more speed?
Not always. A VM with more vCPUs can run more threads at once, but several limits apply:
- A single-threaded application uses only one vCPU, however many are assigned.
- Extra vCPUs help only when the work can run in parallel. If the bottleneck is slow database queries, disk input and output, or memory, adding vCPUs will not fix it.
- A second thread on the same core adds less than a full core. The gain depends on the workload and is usually well below double.
- vCPUs are not comparable across generations or vendors. Clock speed, architecture, and cache all differ, so a 4 vCPU instance from one generation may perform differently from another.
Measure CPU use, load, and queue lengths before you resize a server.
Burstable instances and baselines
Burstable types, such as the AWS T family and the Azure B series, give each vCPU a baseline share of CPU time. They can burst above that baseline for short periods using accumulated credits. The AWS t3.xlarge, for example, has a baseline of 40 percent per vCPU. A workload that runs above the baseline for long periods can use up its credits and slow down. Burstable types suit intermittent workloads, not steady heavy ones.
vCPUs on-premises and in licensing
On-premises hypervisors such as VMware and Hyper-V can assign more vCPUs than there are physical cores. This is called overcommitment. Ratios such as 3:1 to 5:1 are common, although they vary by workload. Some software vendors also license per vCPU or per core, so the vCPU count can affect cost. Check the licensing terms for your software before you add vCPUs.
How to choose a vCPU count
- Start from the workload. Web applications, databases, and batch jobs have different needs.
- Measure current CPU use, and find out whether the application can use multiple threads.
- Test with a realistic load, and compare response times at different sizes.
- Check memory, storage, and network limits too. CPU is only one possible bottleneck.
To see how vCPU counts fit into the wider range of virtual machine types, read the article on VM families. For how the hypervisor creates vCPUs in the first place, see virtualization in cloud computing.