"AWS decides where your servers sit." By default, yes: EC2 tries to spread your instances across the underlying hardware to reduce the chance that they fail together. But you can influence it. A placement group tells EC2 how to place a set of related instances, and that choice changes two things: how fast the instances can talk to each other, and what fails at the same time.
What a placement group is
A placement group is a logical grouping you create first and then launch instances into. You pick a strategy when you create it. There is no charge for creating a placement group; you pay only for the instances.
If EC2 doesn't have suitable hardware for a request, the launch fails rather than quietly ignoring the strategy.
Cluster: close together, for speed
A cluster placement group packs instances close together inside one Availability Zone. The instances sit in the same high-bandwidth segment of the network, so you get low latency and high throughput between them. This is the strategy for tightly coupled work such as high-performance computing, where nodes exchange data constantly.
The trade-off is resilience. A cluster group can't span Availability Zones, so a problem in that zone affects everything in the group.
AWS recommends two habits for cluster groups:
- Launch all the instances you need in a single request.
- Use the same instance type for all of them.
Adding instances later, or mixing types, raises the chance of an insufficient capacity error.
Spread: far apart, for a few critical servers
A spread placement group does the opposite. Each instance is placed on distinct hardware: a different rack, each with its own network and power. A single rack failure can then take out only one instance.
It is meant for a small number of critical instances that must not fail together, such as the nodes of a small quorum-based cluster. A spread group can span Availability Zones in a Region, but it supports at most seven running instances per Availability Zone. Need more? Use several spread groups, or look at partitions.
Partition: groups of racks, for big distributed systems
A partition placement group divides the group into partitions, and each partition gets its own set of racks. No two partitions share racks, so a hardware failure is contained in one partition. You can have up to seven partitions per Availability Zone, with as many instances as your account limits allow.
This suits large distributed and replicated systems such as Kafka, Cassandra and Hadoop. Those systems are topology-aware: you can see which partition each instance is in, and the software can keep replicas of the same data in different partitions.
A common mistake is choosing cluster placement for a database cluster "because it's faster". If the replicas exist to survive hardware failure, packing them together defeats the purpose. Use spread or partition there.
Where AI fits
Distributed model training is exactly the tightly coupled workload cluster placement was built for. When a training job runs across many GPU instances, the nodes exchange gradients and data continuously. If the network between them is slow, expensive GPUs sit waiting. Putting the training nodes in a cluster placement group, on instance types with enhanced networking, keeps node-to-node latency low.
Two practical notes: capacity for GPU instances is often tight, so launching the whole group in one request matters even more. And check the current documentation for how placement groups interact with the capacity option you use; for example, AWS documents that Capacity Blocks for ML do not support placement groups.
Quick recap
- Cluster: one Availability Zone, close together, lowest latency. Fast but fragile.
- Spread: each instance on its own rack, at most seven running per Availability Zone. For a few critical servers.
- Partition: groups of racks, up to seven partitions per Availability Zone. For big distributed systems.
- For AI, cluster placement keeps distributed training fast.