Placement Group – how to improve EC2 performance and stability using AWS Cloud » –

Placement group is a very cool feature to improve compute capacity or improve solution availability that few people notice. This article Kevin shares about Placement Group and the characteristics of each type of Placement Group.

By default, when you launch an EC2 instance, AWS will attempt to initialize the instance on hardware that minimizes errors as much as possible, which means optimally random. This AWS does very well, but if there are some higher requirements, more specific to change this arrangement randomly the way I choose, it is the Placement Group.

placement group creation

There are 3 types of Placement Group that you can choose from:

  1. Cluster – Group of instances in the same AZ. The purpose of this strategy is to create a pool of instances with low-latency-network benefits. This type is necessary for applications that need to be tightly coupled, such as HPC (High Performance Computing) applications.
    1. Does not support burstable performance instances (eg T2) and Mac1.
    2. Can’t span out multiple AZs.
    3. Maximum network performance between 2 instances will be equal to whichever instance has the smaller parameter.
    4. Network traffic to the internet or through DX is limited to 5Gbps.
  2. Partition – This type is divided into different partitions, each of which contains instances, and between partitions that do not share the same hardware. This is beneficial when designing applications that do not allow the death of one group to affect the rest. This type of Placement group is often used for distributed applications such as Hadoop, Cassandra, Kafka.
    1. Supports up to 7 partitions/AZ. Assuming Region has 3 AZs, there will be a maximum of 21 partitions.
    2. When launching a new instance AWS will make an effort to distribute it evenly among the partitions.
    3. If you use Dedicated instances, you can only create up to 02 partitions.
  3. Spread – Place a small group of instances spread across separate hardware to minimize errors.
    1. Works in both Region.
    2. Each AZ can launch up to 7 instances. Each instance will not share the underlying hardware.
    3. Spread placement group does not support Dedicated Instances.

A few general notes when using placement groups:

  1. It is recommended to initialize the placement group with the number of instances at the same time because when adding new instances to an existing placement group, an error may arise due to not having hardware that meets the requirements of the placement group.
  2. When you get an error, re-initialize placement to ensure there are enough resources.
  3. The same instance type should be used when initializing the placement group.
  4. The name of the placement group must be unique in the AWS Region.
  5. Placement groups cannot be merged.
  6. An instance belongs to only one placement group
  7. Dedicated Host cannot be used in placement group.

Leave a Reply