AWS: Cluster, partition and spread placement groups

Tram Ho

1. Placement Groups Overview

  • The placement group determines how instances are placed on the underlying hardware.
  • AWS currently offers three types of placement groups available in EC2 and all of them exist for various reasons. They basically allow us to see or control the actual location – where EC2 instances launch at different levels. We can take advantage of this feature to improve performance or reliability.
    • Cluster – group instances into a low latency cluster when connected to each other in an AZ
    • Partition – distribute instances on logical partitions, ensuring that instances in one partition do not share basic hardware with instances in other partitions.
    • Spread – spreads the instances on the basic hardware

2. Cluster Placement Groups (CPGs)

Cluster placement groups place instances physically near each other in a single AZ. Every instance can talk to every other instance at the same time at full speed. Works with enhanced networking for peak performance.

  • The cluster cluster group puts physical instances close together in an AZ (availability zone). Every instance can communicate with other instances at the same time at full speed. How this works will yield maximum network performance.

  • The purpose of cluster placement group is designed for performance, they are quite easy to configure.
  • Cluster limited to an available area. So when you create a cluster placement group, you don’t need to specify an available area; but when you launch the instance into that placement group, they are locked into the usable area of ​​the first instance that is included. In fact, all it does is make sure that the instances are launched inside a cluster. The placement group is physically close together.

  • It is recommended to start all instances in groups at the same time to ensure capacity. It is possible to add instances later, but it is likely that there is an insufficient capacity error. Assuming you have put 4 EC2 instances into a cluster placement group, AWS will find a suitable time to launch these 4 EC2 instances from there. They can make sure this space is enough for 2 more instances in case you want to launch more but if you want to run up to 4 more instances, you may have capacity problems. Therefore, by selecting instances of the same type and launching them all from the beginning, launching placement group with instances will have a higher chance of success.
  • To move an instance into the placement group:
    • Create an AMI from an existing instance
    • Launch a new instance from this AMI into a placement group
    • Stop and start an instance in the placement group, that instance still runs in the same placement group
    • In case of a capacity error, stop and relaunch all instances in the placement group.
  • Cluster placement groups are only available in a single AZ within the same VPC or peered VPCs.

3. Partition Placement Groups (PPGs)

Instances deployed into a partition placement group (PPG) are separated into partitions (max of seven per AZ), each occupying isolated racks in AZs / regions. PPG can span multiple AZs in a region. PPGs minimize failure to a partition and give you visibility on placement.

  • Instances are deployed into a partition placement group (PPG) that is split into partitions (up to seven per AZ), each instance occupying independent racks in AZs / region. PPG can spread across many AZs in an area. PPG minimizes failures for a partition and allows you to track on placement.

  • Partition placement groups are designed to ensure maximum application availability. A partition is an isolated infrastructure group within AWS. Partitions are also logical object groups, the instances contained therein do not share the same basic hardware on different partitions.
  • In the Availability Zone, you can have multiple partitions. They store, compute, network, and they are separate from each other. The idea is that, if a single partition fails, you won’t lose resources in another partition, so partition placement groups are a way to limit the error-prone domain to be even smaller than the Availability Zones.

  • There can be up to 7 partitions per Availability Zone and can span multiple Availability Zones in the same Region.
  • Partition placement groups tend to be used only for large infrastructure deployments. You may have an application that uses hundreds of EC2 instances and you want to ensure that they are distributed equally to all infrastructure partitions in a region and therefore, you will create a partition placement group that can be spread out. wide on different available regions and each of those available will have up to seven partitions and you can use that partition to divide those instances across all seven partitions. If needed, you can provide that information to applications so that the application itself can see its infrastructure location. Therefore, in general, partition placement groups are designed to ensure the availability and extent of infrastructure for applications that use a large number of EC2 instances.
  • Not supported for Dedicated Hosts. For Dedicated Instances, there can be up to 2 partitions.

4. Spread placement groups (SPGs)

Spread placement groups (SPGs) are designed for a max of seven instances per AZ that need to be separated. Each instance occupies a partition and has an isolated fault domain. Great for email servers, domain controllers, file servers, and application HA pairs.

  • Spread placement groups (SPGs) designed for up to 7 instances per AZ need to be separated. Each instance occupies a partition and has an isolated error domain. This architecture is suitable for email servers, domain controllers, file servers, and application HA pairs.
    • partition placement groups: maximum 7 partitions per AZ.
    • spread placement groups: up to 7 running instances per AZ, each instance will be in its own partition

  • Spread placement groups are a group of instances placed on separate underlying hardware, which can span multiple AZs.
  • Spread placement groups (SPGs) are designed to deploy small infrastructures, applied when you want to ensure that every instance operates on a separate partition. Therefore, this partitioning method is suitable for email servers, domain controllers, file servers, and application, highly available pairs or whatever you need to ensure that when a partition fails, it will not crash. both of your instances.
  • Not supported for Dedicated Instances or Dedicated Hosts.

5. Conclusion

  • When you launch a new EC2 instance, the EC2 service will try to place that instance in such a way that all your instances are spread out evenly on the underlying hardware to minimize correlation errors. You can use placement groups to influence the position of a group of instances of interdependencies to meet your workload needs. Depending on the type of workload, you can create a placement group using one of the following placement strategies:
    • Cluster : wrap instances close together in an Availability Zone. This strategy allows workloads to achieve low latency network performance – essential for tightly interlinked nodes, typical of HPC applications.
    • Partition : distribute instances on logical partitions so that the groups of instances in one partition do not share the hardware with the groups of instances in other partitions. This strategy is often used by distributed and large-scale workloads, such as Hadoop, Cassandra and Kafka.
    • Spread – put a small group of instances on separate underlying hardware to reduce correlation errors.
  • There is no charge for creating a placement group.

References

https://jayendrapatil.com/aws-ec2-placement-groups/

Share the news now

Source : Viblo