Cloud Compute Types: VMs, Containers and Serverless Explained (2026)
Last verified: June 29, 2026 · Format: Breakdown · Reviewed by TechJacks Cloud Infrastructure Team, AWS SAP-C02
Cloud compute types determine the control and management responsibility you take on for the machines running your workloads. Choosing between a virtual machine, a container, and a serverless function drives your cost structure, operational overhead, and scaling behavior. This breakdown compares all three tiers across AWS, Azure, and GCP with verified pricing anchors and a 7-gotcha register from real practitioner failure modes.
All provider figures are from official documentation verified June 29, 2026. Always check live pricing pages before budgeting.
What Is Cloud Compute?
Cloud compute types describe the abstraction level at which you access cloud processing power: raw virtual machines where you control the OS, containers where the platform handles the runtime, or serverless functions where the provider manages everything and charges only for execution time.
Govern the data behind your AI. The AI Data Governance & Quality Assessment: a checklist to keep your data trustworthy.
Your purchase helps keep our hubs free to read.
The three tiers form a ladder of abstraction. IaaS (Infrastructure as a Service) virtual machines give you near-bare-metal control: you manage the OS, the software stack, and the configuration. Containers and managed orchestration platforms remove OS management so you can focus on your application. Serverless strips away all infrastructure concerns: you write a function, configure a trigger, and pay per millisecond of execution.
More control means more operational responsibility and more potential for cost optimization. Less control means faster deployment and simpler operations at the cost of flexibility. The authoritative definition of cloud computing and its five essential characteristics is NIST SP 800-145. For foundational cloud concepts, see What Is Cloud Computing? For the storage tier, see Cloud Storage Types Explained.
Virtual Machines (IaaS)
A hypervisor (virtualization layer) splits one physical server into isolated virtual machines, each running its own operating system. Resources are measured in vCPUs (virtual CPU cores sliced from the host's physical processors) and GiB of RAM. You control the OS, software stack, networking, and storage. The provider manages the physical hardware and the hypervisor beneath.
AWS EC2
Amazon EC2 offers more than 1,000 instance types across compute-optimized, memory-optimized, storage-optimized, and GPU families. The newest general-purpose families — m8g, m7g (Graviton ARM), and m7a (AMD EPYC) — are the default starting points for balanced workloads. AWS built the Nitro System, a custom hardware layer, to offload virtualization overhead and deliver near bare-metal performance. Billing is per second with a 60-second minimum. AWS guarantees a 99.99% monthly uptime SLA for EC2 in Multi-AZ deployments.
Azure Virtual Machines
Azure organizes VMs into six families: General Purpose (Bsv2, Dv5), Compute Optimized (Fasv6), Memory Optimized (M-series, up to 128 vCPUs and 4TB RAM), Storage Optimized (Lasv3), GPU (NCads H100 v5), and HPC (H-series, HB-series). Azure bills Linux VMs per second (1-minute minimum) and Windows VMs per full minute. Azure supports Constrained vCPU instances that limit active vCPU count while keeping the same memory and I/O, reducing SQL Server licensing cost without shrinking the VM.
Azure billing gotcha: A VM in the Stopped state (shut down from inside the OS) still bills for allocated vCPUs. To stop billing, Deallocate from the Azure portal or CLI. Only Deallocated VMs stop generating compute charges.
GCP Compute Engine
GCP machine families: E2 (lowest cost, shared-core options), N-series (N4/N2/N1, balanced), C-series (compute-optimized), Tau T2A/T2D (ARM Ampere Altra), X4/M4 (memory-optimized, up to 32TB RAM), and A4X/A3 (GPU/AI). Billing is per second with a 1-minute minimum. The always-free tier includes one e2-micro, 30GB standard persistent disk, and 1GB outbound/month (regional availability varies — verify at cloud.google.com/free).
GCP has two discount programs: Sustained Use Discounts (SUD) — automatic up to 30% for instances running more than 25% of the billing month — and Committed Use Discounts (CUD) — up to 70% off memory-optimized families (55% for others) on 1- or 3-year commitments. CUD and SUD are mutually exclusive — committing to a CUD voids the automatic SUD for those resources. GCP Spot VMs offer up to 91% off on-demand pricing for preemptible workloads.
| Dimension | AWS EC2 | Azure VMs | GCP Compute Engine |
|---|---|---|---|
| Billing unit | Per second (60s min) | Linux: per second (1-min min) | Windows: per minute | Per second (1-min min) |
| Latest general-purpose | m8g, m7g, m7a | Bsv2, Dv5 series | N4, N2, E2 |
| Max spot discount | Up to 90% | ~81% | Up to 91% |
| Commitment discount | Up to 72% (3-yr Reserved) | Up to 65% (Savings Plan) | Up to 70% CUD (memory) |
| Auto discount | Savings Plans (opt-in) | None automatic | SUD up to 30% (automatic) |
| Free tier VM | t2.micro / t3.micro (12-month trial) | B1s (12-month trial) | e2-micro (verify regional availability) |
| Uptime SLA | 99.99% (Multi-AZ) | 99.9%–99.99% | 99.9% / 99.95% (memory-optimized) |
Containers
Containers package your application code and dependencies into a portable image. Unlike VMs, they share the host OS kernel: lighter, faster to start, and more efficient for running many workloads on the same host.
Think of a container like a standardized shipping container. A physical shipping container holds cargo in a sealed unit that loads onto any ship, truck, or train without repackaging. A software container holds your application and its dependencies in a sealed image that runs identically on a laptop, a test server, or a production cloud cluster. Kubernetes (abbreviated K8s — the 8 letters between the K and the s) is the open-source system, originally built at Google and open-sourced in 2014, that orchestrates containers at scale: scheduling them across server clusters, restarting failed ones, and scaling based on demand. EKS, AKS, and GKE are AWS, Azure, and GCP's fully managed Kubernetes services, respectively.
| Provider | Managed K8s | Simpler container platform | Best for |
|---|---|---|---|
| AWS | EKS | ECS (Elastic Container Service) | ECS for AWS-native simplicity; EKS for K8s portability |
| Azure | AKS | Azure Container Apps | AKS for K8s; Container Apps for serverless-scale microservices |
| GCP | GKE | Cloud Run | GKE for K8s; Cloud Run for fully managed containers at scale |
If you need Kubernetes but want less cluster management, AWS EKS Fargate, Azure AKS Virtual Nodes, and GCP GKE Autopilot all abstract away node provisioning while preserving K8s compatibility. For teams who want containers without Kubernetes complexity, ECS, Container Apps, and Cloud Run are the simpler alternatives.
Serverless
Serverless functions (FaaS — Function as a Service) are the highest abstraction tier: you write a function, configure a trigger, and the provider runs it on demand. You pay only for actual execution time, measured in milliseconds. No servers to patch, no capacity to plan, no idle cost.
Think of serverless like electricity. You don't maintain a power plant to run your lights: you flip a switch, the grid delivers power for exactly as long as needed, and your bill reflects only what you consumed. Serverless works the same way: the provider maintains all infrastructure, your function runs when triggered, and you pay for only the milliseconds it executed.
AWS Lambda
Lambda supports 128MB to 10,240MB in 1MB increments, with CPU scaling proportionally. Pricing uses GB-s (gigabyte-seconds: memory allocated × duration in seconds — a function using 512MB for 2 seconds consumes 1 GB-s): $0.0000166667/GB-s on x86; $0.0000133334/GB-s on ARM (Graviton2, ~20% cheaper). Requests: $0.20/1M requests. Free tier: 1M requests + 400,000 GB-s/month. Provisioned Concurrency costs $0.0000041667/GB-s, billed whether or not your function is invoked.
Provisioned Concurrency pre-warms execution environments at $0.0000041667/GB-s allocated, eliminating cold starts (the latency penalty when the provider spins up a fresh execution environment for a function that hasn't run recently) for latency-sensitive workloads. Lambda SnapStart (Java 11+ and additional runtimes — verify current support at aws.amazon.com/lambda/snapstart/) achieves the same result via initialization snapshots at no added cost.
Azure Functions and GCP Cloud Run
Azure Functions offers Consumption plan (pay-per-execution, 1M requests free) and Premium plan (pre-warmed instances, no cold starts). Durable Functions adds stateful orchestration without an external workflow engine. GCP Cloud Run runs containerized workloads, not raw functions, giving you more runtime control while still billing only for requests and CPU during request handling. Cloud Run includes 2M requests free per month.
Pricing Comparison
| Dimension | AWS | Azure | GCP |
|---|---|---|---|
| VM billing unit | Per second (60s min) | Linux: per second (1-min min) | Windows: per minute | Per second (1-min min) |
| Spot / Preemptible max discount | ~90% | ~81% | ~91% |
| Commitment discount | Up to 72% (3-yr RI) | Up to 65% (Savings Plan) | Up to 70% CUD (memory) |
| Auto discount (no contract) | None — opt-in Savings Plans | None | SUD up to 30% (automatic) |
| Serverless compute rate | $0.0000166667/GB-s (x86) | Consumption: similar model | Cloud Run: vCPU-s + GB-s |
| Serverless free tier | 1M req + 400K GB-s/month | 1M req/month | 2M req/month |
| Free tier VM | t2.micro/t3.micro (12-month trial) | B1s (12-month trial) | e2-micro (verify regional availability) |
Procurement insight: GCP's SUD kicks in automatically, with no contract needed. If VMs run more than 25% of a billing month, you get a discount at zero commitment. AWS and Azure require explicit opt-in to Reserved Instances or Savings Plans for equivalent savings. For workloads with variable utilization, run the math: GCP SUD often wins for 40–70% utilization ranges before a CUD makes sense.
The Gotcha Register
These 7 failure modes appear repeatedly in cloud compute bills and post-mortems. Each has a one-line fix.
Stopping a VM from inside the OS puts it in Stopped state: allocated vCPUs keep billing. Fix: Always Deallocate from the Azure portal or CLI. Only Deallocated VMs stop generating compute charges.
Committing to a CUD (up to 70%) cancels the automatic SUD (up to 30%) for those resources. If your VMs run 40–60% of the month, SUD + no commitment may be cheaper. Fix: Model actual utilization before signing a CUD.
Provisioned Concurrency eliminates cold starts but bills at $0.0000041667/GB-s whether or not your function is invoked. A misconfigured PC setup can cost more than the latency it prevents. Fix: Measure p95 (95th-percentile latency: the response time that 95% of invocations beat) cold-start impact before enabling PC; use it only for latency-critical paths.
EC2 compute is cheap per second, but data transfer out of AWS charges per GB (first 100GB aggregate free). A compute-cheap workload can generate significant egress cost if it moves data frequently. Fix: Add egress to your cost model from day one.
Constrained vCPU instances reduce active vCPU count while keeping the same memory and I/O. SQL Server is licensed per vCPU — a 32GB VM with 4 active vCPUs costs far less in SQL license fees than a standard VM with 8 vCPUs. Fix: Evaluate Constrained vCPU for any SQL Server or per-core licensed workload on Azure.
GCP can reclaim a Spot VM at any time with only 30 seconds of warning. Stateful workloads that cannot checkpoint lose in-progress work. Fix: Use Spot only for batch, fault-tolerant, or checkpointed workloads. Design for graceful shutdown on SIGTERM (the Unix termination signal GCP sends the VM 30 seconds before reclaiming it).
Provisioned Concurrency: pre-warms execution environments at ~$0.0000041667/GB-s allocated. Eliminates cold starts for latency-sensitive workloads. Lambda SnapStart (Java 11+ and additional runtimes — verify current support at aws.amazon.com/lambda/snapstart/) does the same via initialization snapshots at no added cost. Fix: Use SnapStart for supported runtimes; reserve Provisioned Concurrency for runtimes without SnapStart support.
Where to Start
New to cloud compute? Follow this path to hands-on experience:
- Start with a free VM: Create an AWS Free Tier account and spin up a t2.micro instance (750 hours/month free for 12 months), or use GCP's e2-micro (verify regional availability at cloud.google.com/free). You'll learn OS access, networking basics, and what "terminating" vs "stopping" actually means.
- Try containers next: Install Docker, run a container locally, then deploy it to AWS ECS or GCP Cloud Run. This makes the difference between VM and container concrete.
- Experiment with serverless: Deploy one AWS Lambda function with an API Gateway trigger. Run it 10 times and check the pricing dashboard. This makes GB-s billing tangible and shows you exactly what "pay per millisecond" means on an actual invoice.
- Use the picker below to match your first real workload to the right compute tier.
Cloud Compute Service Picker
3 questions to a starting recommendation for your workload. A decision aid, not a prescription.
Test Your Knowledge
AWS, Amazon EC2, and AWS Lambda are trademarks of Amazon Web Services, Inc. Microsoft Azure is a trademark of Microsoft Corporation. Google Cloud Platform and Google Compute Engine are trademarks of Google LLC. All vendor pricing sourced from official documentation June 2026. Verify at each provider's live pricing pages before budgeting.