EC2 Placement Groups

Authors
  • avatar
    Name
    Michael Bui
    Twitter

Overview

Placement groups allow you to place your group of instances in a specific way. You can have them spread across availability zones & hardware for resiliency or on the same rack for low latency tasks.

In this lab, we'll create a cluster, spread, and partition placement group. We'll also look at how to place EC2 isntances into these groups.

Creating Placement Groups

Cluster

  • EC2 instances are placed in the same rack in the same availability zone
  • Lower latency
  • If a rack fails all our EC2 instances fail
  1. Go to EC2 -> Placement Groups
  2. Provide a name & select Cluster as the placement strategy

Spread

  • All EC2 instances are placed on different hardware (racks)
  • Span across multiple availability zones
  • Less risk of simultaneous failure
  • Limited to 7 instances per AZ per placement group
  1. Go to EC2 -> Placement Groups
  2. Provide a name & select Spread as the placement strategy

Partition

  • A partition is a specific rack in that AZ
  • 7 partitions per AZ
  1. Go to EC2 -> Placement Groups
  2. Provide a name & select Partition as the placement strategy
  3. Choose the number of partitions (racks) you want to have

EC2 Instances in Placement Groups

  1. When creating an EC2 instance you can specify which placement group to place it under advanced details
  2. View the details of the placement group when you click on the EC2 instance