EC2 Placement Groups

Photo by Kai-Chieh Chan from Pexels


When launching a group of VM Instances, it is possible to instruct AWS how those instances are distributed across AWS's infrastructure. These instructions are referred to as Placement Groups. AWS defines 3 different methods for distributing these instances.

  • Cluster Placement Group
  • Partition Placement Group
  • Spread Placement Group

Cluster Placement Group

The diagram above represents a set of racks close to each other. This illustrates how instances deployed to a cluster placement group are placed - very close to each other. The cluster placement group (and its instances) are limited to a single Availability Zone but can span peered VPCs.

Throughput

This type of placement is helpful for applications that require a high throughput of networking traffic between the VMs they are deployed to. The throughput, of course, is limited by the slowest instance in the group; therefore, it is recommended to use similar instance types in a cluster placement group.

Even though intra-node throughput can go up to 10 Gbps, traffic to the internet and Direct Connect is limited to 5 Gbps.

Using Jumbo Frames for higher maximum transmission units (MTU) for Intra node traffic routes inside a Cluster Placement Group is recommended.

Capacity

It is recommended to launch all required instances simultaneously if possible. These instances need to be placed close to each other, and a simultaneous launch avoids any later hardware capacity issues. If you run into capacity issues restarting the instances may migrate them all to the same hardware.


Partition Placement Group

A Partition Placement Group does the opposite of a Cluster Placement Group and tries to spread the instances across multiple hardware. A partition is a logical grouping of instances, each assigned to a set of racks, each with its own power supply and networking, to avoid a single point of failure (within an AZ).

A Partition Placement Group can span multiple Availability Zones within a single Region. The number of partitions in a single AZ is limited to 7.

Spread Placement Group

The diagram above is similar to that of a Partition Placement Group. The distinction here is instances rather than partitions. The Spread placement strategy distributes instances across hardware. This solution is ideal when you only deal with a small set of instances. Spread Placement Group limits each AZ to only have 7 VM Instances each.

The Spread Placement Group (like Partition Placement Group) can span multiple availability zones of a region.