Optimising Placement, Networking and Instance Storage
This lesson explains how placement groups, enhanced networking and storage choices affect instance performance beyond the instance type.
Learning outcomes
After completing this lesson, you will be able to:
- Choose a placement group strategy.
- Enable enhanced networking and EFA.
- Choose between instance store and EBS-optimised bandwidth.
Placement groups
A cluster placement group places instances close together within one Availability Zone, giving the lowest latency and highest per-flow throughput (up to 10 Gbps per flow instead of 5 Gbps outside it), which suits tightly coupled HPC and distributed training. A spread placement group places each instance on distinct hardware with its own power and network, with a limit of seven running instances per AZ per group, which suits a small number of critical instances such as domain controllers. A partition placement group divides instances into up to seven partitions per AZ, each on separate racks, and exposes the partition number so that topology-aware systems such as HDFS, HBase, Cassandra and Kafka can place replicas in different partitions.
Capacity errors are more likely in cluster placement groups because all instances must fit in one part of an AZ. AWS recommends launching all instances in a single request, using the same instance type, and, if InsufficientInstanceCapacity occurs, stopping and starting all instances or trying again later. An On-Demand Capacity Reservation in the placement group guarantees capacity. The following table summarises the strategies.
| Strategy | Placement | Use case | Limit |
|---|---|---|---|
| Cluster | Close together in one AZ | HPC, low-latency, high-throughput | One AZ |
| Spread | Each instance on separate hardware | Small sets of critical instances | 7 running instances per AZ per group |
| Partition | Groups of instances on separate racks | Large distributed, replicated systems | 7 partitions per AZ |
Which placement group?
Enhanced networking
Enhanced networking uses single root I/O virtualisation (SR-IOV) for higher bandwidth, more packets per second and lower latency. On current instances it is provided by the Elastic Network Adapter (ENA), with up to 200 Gbps on large types; the AMI must have the ENA driver and the enaSupport attribute. The Elastic Fabric Adapter (EFA) adds an OS-bypass interface for MPI and NCCL applications in HPC and ML, used within a cluster placement group. Instances also have network allowances for bandwidth, packets per second and connection tracking; the ENA driver exposes counters such as bw_in_allowance_exceeded and pps_allowance_exceeded, which the CloudWatch agent can publish, showing when an instance has reached its limits.
Instance store and EBS-optimised bandwidth
Instance store volumes are physically attached NVMe or SSD disks with very high IOPS and no extra cost, but their data is lost when the instance stops, hibernates or terminates, or the underlying disk fails. They suit caches, buffers, scratch data and replicated data. EBS-optimised instances, the default on current types, have dedicated bandwidth to EBS; each type has a maximum EBS bandwidth and IOPS, so a large volume on a small instance can be limited by the instance rather than the volume. The EBS module covers this in detail.
Does the data survive?
Tuning an HPC cluster
A research team runs a simulation across 16 c7gn.16xlarge instances and sees inconsistent run times. Instances were launched one at a time in different AZs. The operator relaunches them in a cluster placement group in a single request with EFA interfaces, using an AMI with current ENA and EFA drivers, and stores scratch data on instance store volumes rather than EBS. Inter-node latency drops and run times become consistent. Results are copied to S3 at the end of each run because instance store data does not survive a stop.
How many running instances can a spread placement group hold per Availability Zone?
Show answer
Seven, each on separate hardware.
Exam Tips
Remember for the exam
- Cluster: lowest latency in one AZ. Spread: separate hardware, 7 per AZ. Partition: separate racks for big distributed systems.
- Launch cluster placement group instances in one request to avoid capacity errors.
- ENA provides enhanced networking; EFA adds OS-bypass for HPC.
- Instance store data is lost on stop or terminate.
- Check the instance's EBS bandwidth limit when volumes underperform.