Placement Groups
Overview
A placement group lets you influence where AWS physically places a set of EC2 instances inside an Availability Zone. By default AWS spreads instances to reduce correlated failures, but some workloads need the opposite (instances as close as possible for speed), or an even stricter guarantee that instances never share hardware.
There are three strategies. A cluster placement group packs instances close together in one AZ for the lowest latency and highest network throughput. A spread placement group puts each instance on distinct hardware to minimise correlated failure. A partition placement group divides instances into logical groups that sit on separate racks, perfect for large distributed systems.
You choose the strategy when creating the group, and then launch instances into it. Placement groups are free, but each strategy brings trade-offs in capacity, size and resilience that the exam loves to test.
Key Concepts
- Cluster: instances packed together in one AZ; lowest latency, up to 10 Gbps per flow (100 Gbps instance bandwidth with ENA); highest risk — a rack failure can affect all.
- Spread: each instance on distinct hardware (own rack: separate network and power); max 7 running instances per AZ per group; can span multiple AZs.
- Partition: instances in up to 7 partitions per AZ, each on its own set of racks; hundreds of instances; partitions can span multiple AZs in a Region.
- Use cluster for HPC, tightly coupled workloads; spread for small, critical instances; partition for HDFS, HBase, Cassandra, Kafka.
- A placement group is free and is limited to one AZ for cluster but can span AZs for spread and partition.
- You cannot merge placement groups; instances can be moved into or out of a group only when stopped (via CLI/SDK).
- For best cluster results use the same instance type, launch all instances in a single request and consider a Capacity Reservation; if you get insufficient capacity, stop/start and retry.
- Enhanced networking (ENA) and Elastic Fabric Adapter (EFA) are required to achieve full performance in a cluster group.
- Some instance types (for example burstable T and Mac) are not supported in cluster groups, and Dedicated Hosts cannot be used in spread groups.
Detailed Notes
The three strategies at a glance
| Cluster | Spread | Partition | |
|---|---|---|---|
| Goal | Lowest latency, highest throughput | Minimise correlated hardware failure | Isolate failure domains for big distributed systems |
| Placement | Same rack/close hardware, one AZ | Each instance on a different rack | Instances grouped into partitions on separate racks |
| Spans AZs? | No | Yes | Yes |
| Instance limit | No fixed limit (capacity-bound) | 7 running instances per AZ per group | Up to 7 partitions per AZ; hundreds of instances |
| Network | Up to 10 Gbps single-flow, high bandwidth | Normal | Normal |
| Failure impact | A rack/hardware fault can affect many instances | One instance only | Only the partition on that rack |
| Typical use | HPC, MPI, ML training, low-latency trading | Critical small clusters (primary/standby, master nodes) | Hadoop/HDFS, HBase, Cassandra, Kafka |
Cluster placement group
Instances are placed in the same low-latency network segment of an AZ. Pair with EFA for MPI and ML collective operations.
- Best practice: same instance family/size, launched together in one request so AWS can find capacity at once.
- If a launch fails with InsufficientInstanceCapacity, stop and restart all instances in the group so they are re-placed together, or use an On-Demand Capacity Reservation with a cluster placement group.
- Instances in peered VPCs in the same Region can also use the group's low-latency path, with a single-flow limit of about 5 Gbps.
- Trade-off: no HA by itself — pair with multiple groups/AZs or a different strategy for resilience.
Spread placement group
Each instance goes on distinct underlying hardware with its own network and power source. Rack spread is available in all supported instances; host spread applies on AWS Outposts.
- Limit: 7 running instances per AZ per group; a spread group across 3 AZs can hold up to 21.
- Ideal for a small number of critical instances that must not fail together, such as a database primary, standby and witness.
- Dedicated Hosts cannot be used in spread groups.
Partition placement group
Each partition has its own set of racks (own power and network); no two partitions share racks. Instances in one partition may share hardware with each other.
- Up to 7 partitions per AZ; you can launch instances into a specific partition or let EC2 distribute them evenly.
- Instance metadata exposes the partition number so topology-aware software (HDFS, Cassandra, Kafka) can place replicas in different partitions.
- Supports hundreds of instances, large-scale systems.
Working with placement groups
# Create and use a cluster placement group
aws ec2 create-placement-group --group-name hpc-cluster --strategy cluster
aws ec2 run-instances --image-id ami-0abc123 --instance-type c6in.32xlarge --count 8 \
--placement GroupName=hpc-cluster --subnet-id subnet-0abc123
# Partition group with 4 partitions
aws ec2 create-placement-group --group-name kafka-pg --strategy partition --partition-count 4
# Spread group
aws ec2 create-placement-group --group-name critical-pg --strategy spread --spread-level rack
Rules and limits
- Group names must be unique within an account and Region.
- Cannot merge groups; an instance can be in one placement group at a time.
- To move an instance into a group it must be in the stopped state (use CLI/SDK
modify-instance-placement). - Auto Scaling groups can use a placement group via the launch template or ASG setting; a spread or cluster group is respected, but the ASG's multi-AZ distribution interacts with cluster (single AZ) limits.
- Reserved Instances: zonal RIs/Capacity Reservations help guarantee capacity in the group.
Placement groups vs. other availability tools
| Need | Use |
|---|---|
| Lowest node-to-node latency | Cluster placement group + EFA |
| Survive one AZ loss | Multiple AZs with ASG and load balancer (not a placement group by itself) |
| Avoid correlated hardware failure for a handful of instances | Spread placement group |
| Rack-aware large data stores | Partition placement group |
| Licence by physical core/socket | Dedicated Host |
Real World Example
Scenario — a quantitative trading firm and a streaming platform use different strategies.
The trading firm runs a tightly coupled risk simulation across 64 compute-optimised instances. Each simulation step exchanges data between all nodes, so network latency is the bottleneck. They create a cluster placement group in a single AZ, launch all 64 identical c6in instances in one request with EFA enabled and back it with a Capacity Reservation. Latency drops by an order of magnitude compared with randomly placed instances, and jobs complete 40% faster.
The streaming platform runs a Kafka cluster with 30 brokers. They use a partition placement group with 6 partitions across three AZs and configure Kafka's rack awareness to match: replicas of a topic partition are always on different EC2 partitions. A single rack failure affects only one partition's brokers and no topic loses all its replicas.
Their critical metadata services (3 ZooKeeper-style quorum nodes) sit in a spread placement group so that no two nodes ever share hardware.
Architecture Diagram
Same AZ vs. separate racks: the three strategies trade latency against fault isolation.
- 1Cluster: all instances sit close together in one AZ for minimum latency and maximum throughput.
- 2Spread: each instance (max 7 per AZ) runs on separate hardware so one failure affects only one instance.
- 3Partition: instances are grouped into partitions on separate racks; a rack fault affects one partition only.
- 4Choose by workload: HPC -> cluster, small critical set -> spread, large replicated stores -> partition.
Best Practices
- ✓Match strategy to workload: cluster for HPC/low latency, spread for small critical instances, partition for large distributed data stores.
- ✓Launch cluster instances together in one request with the same instance type to maximise the chance of getting capacity.
- ✓Use EFA and ENA-enabled instance types to realise the full network benefit of a cluster group.
- ✓Add Capacity Reservations when a cluster group must reliably scale or restart.
- ✓Combine strategies with multi-AZ design; a cluster group alone offers no AZ-level resilience.
- ✓Make topology-aware software use partition info (rack awareness in Kafka, HDFS, Cassandra).
- ✓Keep spread groups small (7 per AZ) and split bigger fleets into partition groups.
- ✓Plan for failure: stop/start all instances in a cluster group if capacity errors occur and automate recovery.
Common Interview Questions
Exam Tips
SAA-C03 focus
- Low latency / high network throughput / HPC -> Cluster. Small, critical, isolated hardware -> Spread. HDFS, Cassandra, Kafka -> Partition.
- Cluster = single AZ; spread and partition can span multiple AZs.
- Spread: max 7 running instances per AZ per group. Partition: max 7 partitions per AZ.
- A cluster group is the worst choice for high availability — a hardware fault can impact all instances.
- Placement groups are free; they don't solve AZ failure — you still need multi-AZ design.
- Best results in a cluster group: same instance type, launch together, EFA/ENA enabled.
- You can't merge groups; moving an instance requires it to be stopped.
- "Reduce the risk of simultaneous hardware failure for a few instances" -> spread placement group.
Chapter quiz
Compute Services · 5 questions
1.A company runs a nightly data-processing job that can be interrupted and restarted without data loss. The job uses hundreds of vCPUs for four hours. Which purchasing option is the MOST cost-effective?
2.A web application on EC2 behind an Application Load Balancer must automatically replace instances whose application stops responding, even though the EC2 status checks still pass. What should be configured?
3.A solutions architect must give partner companies a fixed set of IP addresses to allow-list for a TCP-based API with very high throughput and low latency. Which load balancer should be used?
4.A big-data team is deploying a 40-node Cassandra cluster on EC2. A single rack failure must not take down all replicas of any data. Which placement strategy fits best?
5.An application experiences predictable traffic spikes every weekday at 9 AM, and new instances take five minutes to become ready. Which approach lets the Auto Scaling group have capacity ready before the spike, with the LEAST operational effort?
0 of 5 answered
Finished this lesson?
0 of 64 lessons done · 0% of the course

