AWS vs Azure vs GCP: Who's got the best virtual machines in town
The "Big Three" cloud providers—Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP)—each offer robust virtual machine (VM) services (EC2, Virtual Machines, and Compute Engine, respectively) with a variety of instance types, pricing models, and hardware configurations.
How would you choose the best?
While the decision depends heavily on your existing ecosystem, it's good to know what's the competition looks like
Amazon Web Services (AWS) - EC2
AWS Elastic Compute Cloud (EC2) is the most established and offers the widest variety of instance types.
Types of VMs (Instance Categories)
AWS organizes its instance types into categories based on their primary resource focus:
- General Purpose (e.g., T, M series): Balance of compute, memory, and networking. Good for web servers, development environments, and small/mid-size databases.
- Compute Optimized (e.g., C series): Ideal for compute-bound (high demand for CPU) applications like batch processing and dedicated gaming servers.
- Memory Optimized (e.g., R, X series): Designed for workloads that process large data sets in memory, such as in-memory databases and big data analytics.
- Accelerated Computing (e.g., P, G series): Use hardware accelerators (GPUs, FPGAs) for advanced tasks like machine learning and graphics processing.
- Storage Optimized (e.g., I, D series): Offer high sequential read/write access to large datasets on local storage, suited for NoSQL databases and data warehousing.
Discount Options
AWS offers several ways to save significantly compared to On-Demand pricing:
- Savings Plans: A flexible commitment to a consistent amount of compute usage (measured in USD/hour) for a 1- or 3-year term. They apply across various instance families, regions, and even other compute services (Fargate, Lambda), providing up to a 72% discount.
Unlike Reserved Instances described below, Savings plans are not bound to specific EC2 instance type. You can change the EC2 instance type in mid-plan and still continue getting the benefit of the savings plan. - Reserved Instances (RIs): Commit to specific instance characteristics (type, region, tenancy) for a 1- or 3-year term, offering discounts up to 72%. Standard RIs offer the largest discount for steady-state workloads, while Convertible RIs allow you to change the instance family, OS, or tenancy.
- Spot Instances: Utilize spare AWS capacity for up to a 90% discount. These instances can be interrupted (terminated) with a two-minute warning, making them suitable only for fault-tolerant workloads like batch jobs or testing.
if you unsure of what discount option works for you, it's best to go with Savings Plans.
Types of CPUs
AWS supports a broad range of processors:
- x86 (Intel/AMD): The standard choice, powered by various Intel Xeon and AMD EPYC generations.
- ARM (AWS Graviton): AWS's custom-designed processors offer a compelling price/performance advantage for many general-purpose and memory-optimized workloads (e.g., T4g, M6g series).
Storage
- Ephemeral Storage (Instance Store): Temporary storage physically attached to the host server. Provides very high disk I/O performance but data is lost when the instance is stopped (not rebooted).
- EBS (Elastic Block Store): Network-attached, persistent block storage (like a virtual hard drive). Data persists independently of the VM lifecycle. EBS offers different volume types (e.g., GP3, io2) for various performance and cost requirements.
A Sample General Purpose VM Pricing (Linux, N. Virginia - US East 1)
| Instance | vCPUs | RAM (GiB) | On-Demand (Hourly) | 1-Year RI (All Upfront, Effective Hourly) |
|---|---|---|---|---|
| t3.medium | 2 | 4 | ~$0.0416 | Varies by region, typically ~25–40% off On-Demand |
Note: The actual RI/Savings Plan discount varies based on region, term, and payment option (All Upfront, Partial Upfront, No Upfront).
Microsoft Azure - Virtual Machines
Azure Virtual Machines offers tight integration with the Microsoft ecosystem and strong hybrid cloud capabilities.
Types of VMs (Series)
Azure instances are grouped by series letters, indicating their primary purpose:
- General Purpose (e.g., B, D, Av2 series): Offer a balanced CPU-to-memory ratio, suitable for testing/development, small/medium databases, and web servers.
- Compute Optimized (e.g., Fs series): High CPU-to-memory ratio, ideal for medium-traffic applications, batch processing, and demanding web servers.
- Memory Optimized (e.g., E, M series): High memory-to-CPU ratio, suited for relational database servers and large caches.
- Storage Optimized (e.g., Ls series): High disk throughput and I/O, optimized for NoSQL databases.
- GPU (e.g., N series): Utilizes NVIDIA GPUs for graphics-intensive visualization and deep learning.
Discount Options
Azure's long-term commitment options are structurally similar to AWS's:
- Azure Reservations (Reserved Virtual Machine Instances): Commit to a specific VM size, region, and term (1 or 3 years) for discounts up to 72% compared to Pay-as-you-go. They are ideal for predictable, steady workloads.
- Azure Savings Plan for Compute: A commitment to spend a fixed hourly amount for compute services over 1 or 3 years. It offers flexibility as the discount applies across different VM series and regions, providing savings up to 65%.
- Spot Virtual Machines (formerly Low-Priority VMs): Offer significant savings (up to 90%) by utilizing unused Azure capacity. They can be evicted when Azure needs the capacity back.
Types of CPUs
- x86 (Intel/AMD): Azure offers a variety of VM series based on Intel Xeon and AMD EPYC processors.
- ARM: Azure offers VM series running on the Ampere Altra Arm-based processor (e.g., Dpsv5, Epsv5 series), providing alternative cost-saving and performance profiles.
Storage
- Ephemeral Storage: Referred to as Temporary Storage or Local SSD. Provides low-latency, high-throughput storage that is local to the VM host. Data is lost during maintenance or when the VM is deallocated.
- Block Storage (Managed Disks): Persistent, network-attached storage with different performance tiers (Standard HDD, Standard SSD, Premium SSD, Ultra Disk). Data persists regardless of the VM status.
A Sample General Purpose VM Pricing (Linux, US East)
| Instance | vCPUs | RAM (GiB) | On-Demand (Hourly) | 1-Year Reservation (Effective Hourly) |
|---|---|---|---|---|
| Standard B2s | 2 | 4 | ~$0.0416 | Varies by region/type, typically ~25–40% off Pay-as-you-go |
Note: The Standard B-series are *Burstable** VMs, similar to AWS T-series, offering baseline performance with the ability to burst.*
Google Cloud Platform (GCP) - Compute Engine
GCP Compute Engine is known for its high level of customization and automatic cost savings.
Types of VMs (Machine Families)
GCP offers three main machine family types, but uniquely allows for Custom Machine Types (non-standard vCPU and memory ratios):
- General Purpose (e.g., E2, N2, N1 series): Best price-performance balance, suitable for most common workloads like web servers, containers, and medium databases.
- Compute Optimized (e.g., C2 series): Excellent for compute-intensive workloads like HPC, EDA, and gaming.
- Memory Optimized (e.g., M1, M2 series): Highest memory per core, designed for in-memory databases and data warehousing.
- Accelerator Optimized (e.g., A2 series): For high-performance computing and machine learning using NVIDIA GPUs.
Discount Options
GCP's discounting is unique with its automatic discounts:
- Committed Use Discounts (CUDs): The primary contract-based commitment. You commit to either a minimum resource usage (e.g., 4 vCPUs of an N2 machine type) or a minimum spend for 1 or 3 years. Discounts can reach up to 70% (for resource-based) depending on the machine family. CUDs are GCP's equivalent to RIs and Savings Plans.
- Sustained Use Discounts (SUDs): Automatically applied discounts for VM instances that run for a significant portion (more than 25%) of the month. This provides savings up to 30% without any upfront commitment, making GCP very competitive for workloads with consistent but non-contracted usage.
- Spot VMs (formerly Preemptible VMs): Similar to AWS Spot and Azure Spot, these utilize spare capacity and offer discounts of up to 80%. They can be terminated by GCP with a 30-second notice.
Types of CPUs
- x86 (Intel/AMD): Compute Engine uses various generations of Intel Xeon (e.g., Ice Lake, Skylake) and AMD EPYC (e.g., Milan, Rome) processors.
- ARM (Tau T2A): GCP offers the Tau T2A machine series based on the Ampere Altra ARM processor, which is geared for cloud-native and scale-out workloads.
Storage
- Ephemeral Storage (Local SSD): High-performance, temporary block storage physically attached to the host. Data is lost when the VM is stopped or terminated.
- Block Storage (Persistent Disk): Network-attached, durable storage that comes in different tiers (Standard, Balanced, SSD) and can be resized while the VM is running. Data persists regardless of the VM lifecycle.
A Sample General Purpose VM Pricing (Linux, US Central 1)
| Instance | vCPUs | RAM (GiB) | On-Demand (Hourly) | 1-Year CUD (Effective Hourly) |
|---|---|---|---|---|
| e2-medium | 2 | 4 | ~$0.0435 | Varies by family, typically ~28% off On-Demand |
Note: GCP's on-demand pricing for continuous usage is effectively lower due to the automatic *Sustained Use Discounts*.
Summary Comparison Table
| Feature | AWS EC2 (Elastic Compute Cloud) | Azure Virtual Machines | GCP Compute Engine |
|---|---|---|---|
| Core VM Name | EC2 Instances | Virtual Machines | Compute Engine Instances |
| Key Discount Commitment | Savings Plans (Flexible Spend) & Reserved Instances (Fixed Resource) | Azure Savings Plan (Flexible Spend) & Azure Reservations (Fixed Resource) | Committed Use Discounts (CUDs) (Resource-based or Spend-based) |
| Unique Cost Feature | Broadest range of specialized instance types. | Azure Hybrid Benefit for significant Windows/SQL Server savings. | Sustained Use Discounts (SUDs) applied automatically for long-running VMs. |
| CPU Architectures | x86 (Intel/AMD) and ARM (AWS Graviton) | x86 (Intel/AMD) and ARM (Ampere Altra) | x86 (Intel/AMD) and ARM (Ampere Altra) |
| Ephemeral Storage | Instance Store (Lost on stop/terminate) | Temporary Storage/Local SSD (Lost on deallocation/terminate) | Local SSD (Lost on stop/terminate) |
| Persistent Storage | EBS (Elastic Block Store) | Managed Disks | Persistent Disk |
| Highest Spot Savings | Up to 90% (Spot Instances) | Up to 90% (Spot Virtual Machines) | Up to 80% (Spot VMs) |
What can I do with virtual machines (in the age of Kubernetes)
Virtual machines are a fundamental building block in the cloud.
Await the next post to see how to launch a web app (with an ultra tight budget) securely and efficiently on a virtual machine on AWS.