Jump to calculator inputs

VM Sizing Calculator

Calculate optimal virtual machine sizes for AWS, Azure, and Google Cloud. Get CPU, memory, and storage recommendations with cost estimates.

Try a common workload

cores
GB
GB
Illustrative cost rates — replace with your quote

Capacity and cost assumptions you can check

Users-per-vCPU and memory ratios are planning heuristics, not load-test results. The cost model uses editable rates and duplicates storage for each instance. Rates start with illustrative values and are not provider quotes; network, licenses, load balancers and tax are excluded. For GPU workloads, enter an hourly GPU allowance. Check supported instance shapes and benchmark peak traffic before purchasing.

AWS estimate configuration guide · Reviewed October 3, 2026

Recommended VM Configuration

Calculated

Check provider availability and pricing

Provider Shape selection vCPU Memory Official pricing calculator

Optimization Recommendations

Frequently Asked Questions

How do I choose the right VM size for my application?
Choosing the right VM size involves profiling your workload and matching resource types (CPU, RAM, network, storage) to the demand pattern. Step 1 — Identify your bottleneck resource: CPU-bound: compute-intensive tasks (data processing, video encoding, code compilation, scientific simulation). Choose compute-optimized instances (AWS c5/c6i, GCP c2, Azure Fsv2). Memory-bound: large datasets in RAM, caching, in-memory databases (Redis, Elasticsearch). Choose memory-optimized instances (AWS r5/r6i, GCP M2, Azure Ev5). I/O-bound: high database read/write, log processing. Choose storage-optimized or high-IOPS instances. Network-bound: high-throughput data transfer, real-time streaming. Look for enhanced networking instances. Step 2 — Estimate resource requirements: for CPU: identify peak concurrent requests and CPU per request. Common starting points: web app: 2 vCPU for < 50 req/s; 4 vCPU for 50–200 req/s. Database: 4–8 vCPU for medium load; scale up for OLAP queries. For RAM: web server: 1–2 GB per worker process, × number of workers. Database: 2× the working dataset (data frequently queried). Cache (Redis): 1.2–1.5× peak data size. Step 3 — Add headroom: P95 metric: right-size to your 95th percentile resource usage, not your average. Provisioning for the average leaves insufficient headroom for traffic spikes. Add 30–50% buffer above P95 for unexpected spikes. Step 4 — Cost-optimize: run baseline workload on on-demand first to validate sizing. Convert steady-state to reserved instances (1-year: ~35% discount; 3-year: ~55% discount). Use spot/preemptible instances for fault-tolerant batch jobs (60–90% discount but interruptible). Step 5 — Right-size iteratively: after first week of production, review CPU and memory utilization metrics. Downsize if consistently < 30% utilized. Upsize if consistently > 70% (or if memory usage causes swapping).
What is the difference between vCPU and physical CPU cores?
vCPU (virtual CPU) is the logical compute unit assigned to a virtual machine — it does not directly correspond to a physical CPU core. Understanding the relationship: physical CPUs: a server in a data center has physical processors with physical cores. Modern server CPUs (AMD EPYC, Intel Xeon) have 16–192 physical cores per processor. Simultaneous Multi-Threading (SMT / HyperThreading): each physical core typically presents 2 logical threads to the operating system. These are the "virtual cores" that cloud providers offer as vCPUs. A 32-core server with SMT = 64 vCPUs available for allocation. vCPU allocation: a VM with 4 vCPUs is allocated 4 of these logical threads. Cloud providers guarantee these are dedicated to your VM during execution. Overcommitment: cloud providers often overcommit vCPUs — selling more vCPUs than physically exist on the host. This works because most VMs don't use 100% CPU simultaneously. "noisy neighbor" problem: if neighboring VMs are CPU-intensive, your VM competes for physical CPU time. Premium instances (bare metal, dedicated hosts, dedicated tenancy): bypass hypervisor; your VM runs directly on physical hardware. vCPU performance caveats: not all vCPUs are equal: a vCPU on an AWS c6i instance (backed by Intel Ice Lake) performs differently than a vCPU on an older t2 instance (older CPU generations). Burstable instances (t3, t4g): do NOT provide continuous full-speed CPU access. They accumulate "CPU credits" and burst when credits are available. Sustained compute workloads will throttle on burstable instances. Managed Kubernetes (EKS, GKE, AKS): vCPU requests vs. limits: request = guaranteed minimum (CPU scheduling). Limit = maximum allowed. Over-provisioning with "request: 100m, limit: 1000m" is common but reduces scheduling predictability. For memory: requests should be close to actual usage (no overcommit on RAM — OOM kills are common if underestimated).
How much RAM should I allocate to a virtual machine?
RAM allocation depends heavily on the application type, operating system overhead, and working dataset size. General RAM sizing principles: OS baseline: Linux: ~200–500 MB OS overhead. Windows Server: ~1–2 GB OS overhead. Per-process RAM: each application server worker/thread uses RAM. Node.js: ~80–200 MB per process. PHP-FPM: ~50–150 MB per process. Java (JVM): 512 MB–2 GB heap + JVM overhead. Python (Django/Flask): ~100–300 MB per worker. Working dataset rules: cache (Redis): provision 1.2–1.5× peak data size (for overhead and working memory). PostgreSQL: aim to fit your working dataset (frequently accessed tables/indexes) in shared_buffers (typically 25% of RAM). MySQL/InnoDB: aim to fit the active dataset in innodb_buffer_pool_size (typically 50–80% of RAM). Headroom guidance: always provision headroom above your expected RSS (Resident Set Size): web app with 10 workers × 200 MB each = 2 GB process RAM + 500 MB OS = 2.5 GB minimum → use a 4 GB VM. Database with 8 GB working dataset: want 8 GB in buffer pool → allocate 12–16 GB RAM total. Monitoring signal: watch for: swap usage > 0: VM is swapping to disk — memory is insufficient. OOM (Out of Memory) kills: OS is killing processes — severe RAM shortage. Memory utilization consistently > 80%: risk of OOM under load spike. Right-sizing guidance: if RAM utilization is consistently < 30%: consider downsizing to a smaller instance (cost savings). If RAM utilization is 50–70%: healthy operating range with headroom. If RAM utilization is > 80%: risk of OOM; upsize or optimize application memory usage.
When should I use reserved instances vs on-demand cloud VMs?
Choosing between on-demand and reserved instances is primarily a cost-optimization decision based on how long and predictably your VM will run. On-demand pricing: pay by the hour or second. No commitment. Full flexibility — spin up/down anytime. Most expensive option. Best for: development and testing environments. Variable workloads with unpredictable hours. New applications during sizing/validation phase. Traffic spikes and burst capacity. Reserved instances (AWS) / Committed use discounts (GCP) / Azure Reserved VM Instances: you commit to using a specific instance type in a specific region for 1 or 3 years. Discounts: 1-year: ~30–40% cheaper than on-demand. 3-year (all upfront): ~55–65% cheaper than on-demand. Payment options: all upfront (maximum discount), partial upfront, no upfront. Best for: production workloads running 24/7. Steady-state compute (web servers, application servers). Databases that must always be running. Break-even analysis: on-demand vs. 1-year reserved: if you run a VM > ~50–60% of the time, reserved is almost always cheaper. For 24/7 workloads, reserved pays back in 5–8 months; you save 30–40% over the remaining 4–7 months. Spot instances (AWS) / Preemptible (GCP) / Spot (Azure): up to 90% cheaper than on-demand. Cloud provider can reclaim with 2-minute warning (AWS) or 30-second warning (GCP). Best for: fault-tolerant batch jobs. ML training with checkpointing. Stateless horizontal scaling. Data processing pipelines. NOT for: databases, stateful apps, anything that can't tolerate interruption. Savings Plans (AWS): commitment to a spending amount (not instance type) per hour. More flexible than reserved — applies to any instance family. Compute Savings Plan: 1 or 3 year; ~17–66% discount depending on commitment. Decision framework: new workload: start on-demand. Running > 50% of time: switch to reserved (1-year). Fault-tolerant batch: use spot. Steady-state production: reserved + savings plan combo for maximum savings.

VM Sizing Guide: Choosing the Right Virtual Machine

Selecting the right virtual machine size is crucial for balancing performance, cost, and scalability in cloud environments. This comprehensive guide will help you understand how to properly size VMs for AWS EC2, Azure Virtual Machines, and Google Compute Engine.

Family vCPUs RAM Range Use Case
AWS EC2 Instance Families Reference
t3/t4g (General, burstable)2–80.5–32 GBDev/test, low-traffic web apps, microservices
m5/m6i (General purpose)2–968–384 GBWeb servers, mid-size databases, app servers
c5/c6i (Compute optimized)2–964–192 GBHigh-traffic web frontends, batch processing, CI/CD
r5/r6i (Memory optimized)2–9616–768 GBIn-memory databases, large data sets, real-time caches
x2idn (Memory optimized, large)32–128512–2,048 GBSAP HANA, large analytics, high-memory databases
i3/i4i (Storage optimized)2–9615.25–768 GBNoSQL databases, data warehouses, log analytics
p3/p4d (GPU)8–9661–1,152 GBML training, inference, HPC simulation
Note: vCPU counts and RAM are AWS-specific. Each cloud provider has equivalent instance families. Always check current pricing at the provider's calculator — instance generations and prices change frequently.
Workload CPU Rule RAM Rule Storage Rule
VM Sizing Rules of Thumb by Workload Reference
Web server (static/CDN)1–2 vCPU per 100 rps512MB–1GB baseSSD; small (OS + app)
Web server (dynamic, PHP/Node)1 vCPU per 50–100 rps1–2 GB base + worker memorySSD; 20–50 GB
MySQL / PostgreSQL (medium)4–8 vCPU2× working dataset in RAMNVMe SSD; InnoDB buffer pool
Redis / Memcached1–2 vCPU1.25–1.5× peak data sizeEphemeral SSD or RAM
Kubernetes node4+ vCPU8–16 GB baseline50–100 GB system + container
CI/CD runner2–4 vCPU4–8 GB50–100 GB (build artifacts)
ML inference (CPU)4–16 vCPUModel size × 2Fast local SSD
ML inference (GPU)4–8 vCPU + GPUModel size × 2 (GPU VRAM)High-throughput storage
Note: These are starting points. Profile your actual workload under representative load, then right-size. Over-provisioning by 30–50% from your P95 metric provides adequate headroom.
Instance Provider vCPU RAM ~$/month
Cloud VM Monthly Cost Reference (2024, us-east-1 on-demand)
t3.smallAWS22 GB~$16
t3.mediumAWS24 GB~$32
m6i.largeAWS28 GB~$69
m6i.xlargeAWS416 GB~$138
c6i.2xlargeAWS816 GB~$246
r6i.xlargeAWS432 GB~$231
Standard_D2s_v5Azure28 GB~$70
n2-standard-4GCP416 GB~$146
Note: On-demand pricing (no commitment). Reserved instances (1-year) typically 30–40% cheaper. Spot/Preemptible instances 60–90% cheaper but interruptible.

Understanding VM Resource Requirements

Virtual machine sizing involves three primary resources: CPU, memory, and storage. Each workload type has different requirements for these resources.

CPU (vCPU) Considerations

vCPUs determine your VM's processing power. Key factors to consider:

  • Application threads: Multi-threaded applications benefit from more vCPUs
  • Peak vs. average load: Size for peak with autoscaling capabilities
  • CPU burst: Some instance types offer burstable performance (AWS T-series, Azure B-series)
  • CPU architecture: Consider ARM-based options for cost savings (AWS Graviton, Azure Ampere)

Memory (RAM) Requirements

Memory is often the most critical resource for many applications:

  • Databases: Typically need 2-4GB RAM per 1 vCPU minimum
  • Web servers: 1-2GB per vCPU is usually sufficient
  • In-memory caching: Size based on cache requirements (Redis, Memcached)
  • Java applications: Account for JVM heap size plus overhead

Storage Performance

Storage IOPS and throughput significantly impact application performance:

  • SSD/NVMe: 3,000-16,000+ IOPS for databases and high I/O workloads
  • Standard HDD: 100-500 IOPS for archives and cold storage
  • Provisioned IOPS: Guaranteed performance for production databases

Workload-Specific Sizing Guidelines

Web Servers and APIs

Traffic Level vCPU Memory AWS Example
Low (< 100 req/s)24 GBt3.medium
Medium (100-500 req/s)48 GBm5.large
High (500-2000 req/s)816 GBm5.xlarge
Very High (2000+ req/s)16+32+ GBm5.2xlarge+

Database Servers

Database Size vCPU Memory Storage IOPS
Small (< 10 GB)28 GB3,000
Medium (10-100 GB)416 GB6,000
Large (100-500 GB)832 GB10,000
Enterprise (500+ GB)16+64+ GB16,000+

Machine Learning Workloads

ML workloads often require specialized instances with GPUs:

  • Training: GPU instances (AWS p4d, Azure NC, GCP A100)
  • Inference: GPU or high-CPU instances depending on model
  • Data preprocessing: Memory-optimized instances

Cloud Provider Instance Families

AWS EC2 Instance Types

  • T-series (t3, t4g): Burstable, cost-effective for variable workloads
  • M-series (m5, m6i): General purpose, balanced compute/memory
  • C-series (c5, c6i): Compute optimized for CPU-intensive tasks
  • R-series (r5, r6i): Memory optimized for databases and caching
  • I-series (i3, i4i): Storage optimized with high IOPS

Azure VM Series

  • B-series: Burstable instances for development and testing
  • D-series: General purpose with balanced resources
  • F-series: Compute optimized for batch processing
  • E-series: Memory optimized for large databases
  • L-series: Storage optimized for data warehousing

Google Cloud Machine Types

  • E2: Cost-effective for most workloads
  • N2/N2D: Balanced performance for general purpose
  • C2: Compute optimized for compute-heavy applications
  • M2: Memory optimized for in-memory databases
  • A2: Accelerator optimized with GPUs

Cost Optimization Strategies

Right-Sizing

Monitor actual resource utilization and adjust VM sizes accordingly. Most cloud providers offer rightsizing recommendations based on usage patterns.

Reserved Instances / Savings Plans

For predictable workloads, commit to 1-3 year terms for 30-72% savings:

  • AWS: Reserved Instances, Savings Plans
  • Azure: Reserved VM Instances
  • GCP: Committed Use Discounts

Spot/Preemptible Instances

Use spot instances for fault-tolerant workloads at up to 90% discount:

  • AWS: Spot Instances
  • Azure: Spot VMs
  • GCP: Preemptible VMs, Spot VMs

Auto-Scaling

Implement horizontal auto-scaling to automatically add/remove instances based on demand, optimizing costs during low-traffic periods.

High Availability Considerations

For production workloads, always plan for redundancy:

  • Multiple instances: Deploy at least 2 instances behind a load balancer
  • Multiple zones: Distribute across availability zones for zone failure protection
  • Multiple regions: For disaster recovery, replicate to another region
  • Database replication: Use managed database services with automatic failover

Monitoring and Optimization

After deploying your VMs, continuously monitor and optimize:

  • Set up CPU, memory, and disk utilization alerts
  • Review weekly/monthly utilization reports
  • Use cloud-native cost management tools
  • Consider containerization for better resource utilization
  • Implement proper tagging for cost allocation

Conclusion

Proper VM sizing is an ongoing process that requires understanding your application's requirements, monitoring actual usage, and adjusting resources accordingly. Use our VM Sizing Calculator above to get initial recommendations, then refine based on real-world performance data. Remember that cloud resources are elastic - you can always scale up or down as your needs change.