Certopolis

AWS Certified CloudOps Engineer – Associate

EC2 placement groups: cluster vs partition vs spread

The EC2 User Guide describes three main strategies. A cluster placement group packs instances close together in one Availability Zone for low latency and high throughput. A partition placement group splits instances into partitions that share no racks. A spread placement group puts each instance on distinct hardware, with at most seven running instances per Availability Zone.

When do you use a cluster placement group?

Use it when most of the traffic is between the instances in the group and the application needs low network latency, high network throughput, or both. The instances sit in the same high-bisection bandwidth segment of the network. A cluster placement group cannot span Availability Zones.

Current generation instance types are supported, except burstable performance instances such as T2, Mac1 instances and M7i-flex instances. Instances with enhanced networking can use up to 10 Gbps for single-flow traffic inside the group, against 5 Gbps outside one.

AWS recommends launching all the instances you need in a single request and using one instance type. Adding instances later, or mixing types, raises the chance of an insufficient capacity error. If a launch into a group with running instances fails for capacity, stop and start all the instances in the group and try again.

When do you use a partition placement group?

Use it for large distributed and replicated workloads such as HDFS, HBase and Cassandra. EC2 gives each partition its own set of racks, and each rack has its own network and power source, so a hardware failure affects one partition only.

A partition placement group can have up to seven partitions per Availability Zone and can use several zones in a Region. The number of instances is limited only by your account limits. You can see which instances are in which partition and pass that to topology-aware applications. EC2 tries to spread instances evenly across partitions but does not guarantee it.

When do you use a spread placement group?

Use it for a small number of critical instances that must be kept apart. Each instance is placed on distinct hardware, which suits mixing instance types or launching instances over time.

A rack-level spread placement group can span Availability Zones in a Region but supports at most seven running instances in each zone. An eighth instance in a zone that already has seven does not launch. If you need more, AWS recommends using several spread placement groups.

If there is not enough unique hardware for a launch or start in a spread or partition group, the request fails, and you can try again later.

Where the exam catches people

  • Choosing a spread placement group for more than seven instances in one Availability Zone: the limit is seven running instances per zone.
  • Stretching a cluster placement group across Availability Zones for resilience: a cluster placement group cannot span zones.
  • Believing the spread limit counts stopped instances: the limit is on running instances in each zone.
  • Putting burstable T2 instances in a cluster placement group: burstable performance instances are not supported there.
  • Believing partitions always hold equal numbers of instances: EC2 tries for an even distribution but does not guarantee it.

Written from these sources

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A SysOps administrator runs six memory optimized Amazon EC2 instances that host a self-managed in-memory cache. Every write on one node is copied to all the other nodes, and the copies must complete with the lowest possible network latency. The administrator will relaunch the six nodes in one Availability Zone into a placement group. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Monitoring, Logging, Analysis, Remediation, and Performance Optimization building.

    Not that one: A is right. In the game your Monitoring, Logging, Analysis, Remediation, and Performance Optimization building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The memory optimized instances are a current-generation, non-burstable type, so they can run in a cluster group.

    Written from docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-strategies.html

  2. Seven instances of a licensing service run in a rack-level spread placement group in one Availability Zone. A SysOps administrator must replace one of them with a new instance launched from an updated AMI into the same group. The old instance must stay available for a rollback until the new one is verified, and no two running instances may share a rack. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Monitoring, Logging, Analysis, Remediation, and Performance Optimization building.

    Not that one: B is right. In the game your Monitoring, Logging, Analysis, Remediation, and Performance Optimization building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Only after verification is the old instance terminated.

    Written from docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-strategies.html

  3. A SysOps administrator runs a 48-node Apache HBase cluster on Amazon EC2 in a partition placement group with four partitions. A rack-awareness script on each node must report which failure domain the node belongs to, so that HBase keeps copies of the same data on nodes that do not share racks. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Monitoring, Logging, Analysis, Remediation, and Performance Optimization building.

    Not that one: B is right. In the game your Monitoring, Logging, Analysis, Remediation, and Performance Optimization building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Inside the instance, the metadata path placement/partition-number returns that number, so the script on every node can report it directly and HBase can place copies on nodes in different partitions.

    Written from docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-strategies.html

Ask for something