Skip to main content
Multi-Cloud · lesson 3 of 8
Multi-Cloud intermediate Lesson 3 of 8

Compute Instance Types Decoded: AWS vs Azure vs GCP

One workload — 4 vCPU, 16 GB RAM, general purpose — priced and decoded across AWS, Azure, and GCP naming conventions, with real on-demand rates compared.

By SkillByExample · Published

cloud aws azure gcp compute pricing

Same workload — 4 vCPU, 16 GB RAM, general purpose, no GPU, no local NVMe requirement — on three clouds. The specs match almost exactly; the names don’t look like it.

The instances

CloudInstance typevCPURAMOn-demand (approx, list price)
AWSm5.xlarge416 GB$0.192 / hr
AWS (burstable)t3.xlarge416 GB$0.166 / hr
AzureStandard_D4s_v5416 GB$0.192 / hr
GCPn2-standard-4416 GB$0.194 / hr

These are published list rates for a US region, on-demand, Linux — not a quote, and they move (a few cents, roughly quarterly). The number that survives any price change is the one worth remembering: the three non-burstable options land within a cent of each other. General-purpose compute is the most commoditized layer of any cloud, so on-demand price is a weak differentiator — reserved/committed-use discounts, egress, and managed-service fit are where the real cost differences show up.

Decoding the names

AWS: m5.xlarge

   m        5       xlarge
   |        |       |
family   generation  size
  • m = general purpose family (t = burstable, c = compute-optimized, r = memory-optimized)
  • 5 = 5th generation of that family’s underlying hardware
  • xlarge = size tier. Sizes double each step: medium (1 vCPU) -> large (2) -> xlarge (4) -> 2xlarge (8) -> 4xlarge (16) — RAM doubles in lockstep for a given family, which is why xlarge reliably means 4 vCPU / 16 GB across the whole m5 line.

Azure: Standard_D4s_v5

Standard_  D    4      s        _v5
           |    |      |          |
        family vCPU  premium-  generation
                      storage
  • D = general purpose family (E = memory-optimized, F = compute-optimized)
  • 4 = vCPU count, stated directly in the name — no lookup table needed
  • s = supports Premium SSD/Ultra Disk (its absence, Standard_D4_v5, caps you at Standard SSD/HDD — the same vCPU and RAM either way)
  • v5 = generation

GCP: n2-standard-4

n2  -  standard  -  4
|         |         |
series   tier      vCPU
  • n2 = machine series (2nd-generation general purpose; n1 is the older series, c2 is compute-optimized, m2 is memory-optimized)
  • standard = memory tier for this series (highmem doubles RAM per vCPU, highcpu quarters it)
  • 4 = vCPU count, also stated directly — GCP and Azure both put the number in the name; AWS is the one where you memorize (or look up) what xlarge means.

Checking the specs against the cloud’s own source of truth

Rather than trust a table (including this one, months from now), ask each CLI directly.

aws ec2 describe-instance-types --instance-types m5.xlarge \
  --query "InstanceTypes[0].{vCPU:VCpuInfo.DefaultVCpus,MemoryMiB:MemoryInfo.SizeInMiB}"
$ aws ec2 describe-instance-types --instance-types m5.xlarge --query "InstanceTypes[0].{vCPU:VCpuInfo.DefaultVCpus,MemoryMiB:MemoryInfo.SizeInMiB}"
{
    "vCPU": 4,
    "MemoryMiB": 16384
}
az vm list-skus --size Standard_D4s_v5 --resource-type virtualMachines \
  --query "[0].capabilities[?name=='vCPUs' || name=='MemoryGB']"
$ az vm list-skus --size Standard_D4s_v5 --resource-type virtualMachines --query "[0].capabilities[?name=='vCPUs' || name=='MemoryGB']"
[
  { "name": "vCPUs", "value": "4" },
  { "name": "MemoryGB", "value": "16" }
]
gcloud compute machine-types describe n2-standard-4 --zone=us-central1-a \
  --format="value(guestCpus,memoryMb)"
$ gcloud compute machine-types describe n2-standard-4 --zone=us-central1-a --format="value(guestCpus,memoryMb)"
4    16384

All three agree: 4 vCPU, 16384 MiB. The naming schemes disagree; the hardware you’re renting doesn’t.

Practice

1. Find the AWS instance type that is one size step down from `m5.xlarge`, and state its vCPU/RAM without looking it up.

m5.large — the size tier below xlarge. Following the doubling pattern, that’s 2 vCPU and 8 GB RAM, half of m5.xlarge on both dimensions.

2. Name the Azure size that has the same vCPU/RAM as `Standard_D4s_v5` but without Premium SSD support.

Standard_D4_v5 — dropping the s removes Premium SSD/Ultra Disk support and nothing else; vCPU and RAM stay 4 and 16 GB.

3. Find the GCP high-memory equivalent of `n2-standard-4` and state its RAM.
gcloud compute machine-types describe n2-highmem-4 --zone=us-central1-a --format="value(guestCpus,memoryMb)"
4    32768

Same 4 vCPU, double the RAM (32 GB vs 16 GB) — highmem doubles the memory-per-vCPU ratio within the same series and vCPU count.

4. A workload needs 4 vCPU but only bursts above 20% CPU a few minutes an hour. Which instance type saves the most money, and on which cloud?

AWS’s t3.xlarge at ~$0.166/hr — about 13% cheaper than m5.xlarge — because burstable instances bill for baseline CPU and let you spend accumulated credits during short spikes. Azure and GCP don’t have a directly equivalent credit-based discount tier at this size; their standard general-purpose price is the standard price whether the CPU is idle or not.

5. Compare `m5.xlarge`'s on-demand price to its 1-year and 3-year Reserved Instance price using the AWS CLI or Pricing Calculator, and compute the discount percentage.
aws pricing get-products --service-code AmazonEC2 \
  --filters "Type=TERM_MATCH,Field=instanceType,Value=m5.xlarge" "Type=TERM_MATCH,Field=location,Value=US East (N. Virginia)"

A 1-year no-upfront Reserved Instance typically runs 30-40% below on-demand, and a 3-year all-upfront commitment 50-60% below — this is exactly the discounting lever mentioned above that on-demand list price hides completely.

Next: the same upload-list-sign task against S3, Blob Storage, and GCS, one script per cloud, with the actual output from each API.

Frequently Asked Questions

What AWS instance type is equivalent to Azure's Standard_D4s_v5?
m5.xlarge for steady general-purpose work, or t3.xlarge if the workload is bursty and can tolerate CPU credit limits. Both give 4 vCPU and 16 GB RAM; the difference is whether the CPU allocation is constant (m5) or credit-based (t3), which Standard_D4s_v5 does not have an equivalent distinction for — Azure's Dv5 series is constant-performance throughout.
Why do AWS, Azure, and GCP general-purpose prices look so similar?
Because general-purpose compute is the most commoditized, most price-shopped tier on every cloud, so list prices have converged to within a few cents per hour of each other. Differentiate on discounting (reserved/committed-use pricing), egress, and managed-service maturity instead of on-demand compute price — the sticker price alone won't tell you much.
What does the 's' mean in Azure's Standard_D4s_v5?
Premium SSD support. The non-s variant (Standard_D4_v5) can only attach Standard SSD/HDD disks; adding 's' means the VM size supports Premium SSD and Ultra Disk. It has nothing to do with CPU or memory, which is why two sizes can differ only by that one letter.
Does a bigger instance-type number mean a newer or better instance?
It means newer generation, not necessarily better for your workload. AWS's m5 came after m4 (newer silicon, usually better price-performance), Azure's Dv5 came after Dv4, and GCP's n2 came after n1 — but a workload tuned for one generation's CPU features doesn't automatically benefit from the next, so re-benchmark rather than assuming.