EC2 Instance Density Calculator
Find how many containers or VMs pack onto one EC2 instance after reservations, and which dimension binds first.
About EC2 Instance Density Calculator
Packing density is a two-dimensional floor division, and the smaller of the two answers wins — one dimension always runs out first and the other's remainder is stranded. Reservations matter more than they look on small instances: 0.5 vCPU and 4 GB held back is 3% of a 16-vCPU node but a quarter of a 2-vCPU one, which is why larger nodes pack more efficiently. The binding dimension tells you which way to change instance shape — memory-bound packing wants an R family, vCPU-bound packing wants a C family — and that choice moves cost per workload far more than shaving requests.
Formula
EC2 Instance Density
density = min(floor(allocatable vCPU ÷ vCPU request), floor(allocatable memory ÷ memory request), hard limit); instances = ceil(workloads ÷ density).
- allocatable
- Instance capacity left after OS and agent reservations
- request
- Guaranteed resource each workload asks for
- hard limit
- Pods, ENIs or secondary IPs the instance type allows
Worked example
With the default values below, EC2 Instance Density Calculator returns Instances Required of 14. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Instance vCPUsaccepts 1–448 vCPU
- 16 vCPU
- Instance memoryaccepts 0.5–24,576 GB
- 64 GB
- vCPU reserved for the OS and agentsaccepts 0–64 vCPU
- 0.5 vCPU
- Memory reserved for the OS and agentsaccepts 0–512 GB
- 4 GB
- vCPU requested per workloadaccepts 0.05–128 vCPU
- 0.5 vCPU
- Memory requested per workloadaccepts 0.05–1,024 GB
- 2 GB
- Workloads to placeaccepts 1–1,000,000 workloads
- 400 workloads
- Hard per-instance workload limitaccepts 1–1,000 workloads
- 110 workloads
Results
- Instances Required
- 14
- Workloads per Instance
- 30
- Binding Constraint
- Memory requests fill the instance first
- vCPU Filled
- 93.8%
- Memory Filled
- 93.8%
- Spare Slots in the Last Instance
- 20
Step by step
- 1Values used
- 2EC2 Instance Density
- 3Instances Required= 14
- 4Workloads per Instance= 30
- 5Binding Constraint= Memory requests fill the instance first
- 6vCPU Filled= 93.8
- 7Memory Filled= 93.8
- 8Spare Slots in the Last Instance= 20
Assumptions and limits
- The result is derived only from the 8 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax or compounding frequency into account.
- Figures are rounded for display to 1 decimal place, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
How is EC2 Instance Density calculated?
density = min(floor(allocatable vCPU ÷ vCPU request), floor(allocatable memory ÷ memory request), hard limit); instances = ceil(workloads ÷ density). Packing density is a two-dimensional floor division, and the smaller of the two answers wins — one dimension always runs out first and the other's remainder is stranded. Reservations matter more than they look on small instances: 0.5 vCPU and 4 GB held back is 3% of a 16-vCPU node but a quarter of a 2-vCPU one, which is why larger nodes pack more efficiently.
Why does EC2 Instance Density matter?
The binding dimension tells you which way to change instance shape — memory-bound packing wants an R family, vCPU-bound packing wants a C family — and that choice moves cost per workload far more than shaving requests.
What values do I need to enter?
This calculator takes 8 inputs: Instance vCPUs, Instance memory, vCPU reserved for the OS and agents, Memory reserved for the OS and agents, vCPU requested per workload, Memory requested per workload, Workloads to place, Hard per-instance workload limit. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
Related Calculators
You might also need
- EC2 Instance Right-Sizing CalculatorCommonly used together
- EC2 Memory Utilization CalculatorCommonly used together
- EC2 vCPU Requirement CalculatorCommonly used together
- Reserved Instance Savings CalculatorAlso in AWS Compute
- EC2 Instance Cost CalculatorAlso in AWS Compute
- EC2 Boot Time CalculatorAlso in AWS Compute
