EC2 201 Flashcards

1
Q

What is a placement group?

A

When you create an instance on EC2, AWS will automatically, intelligently place it in such a way that you’re less likely to have multiple instances fail (e.g. avoiding using the same hardware for two instances).

However, if you want to influence AWS’s placement strategy further, you can create a PLACEMENT GROUP of several instances, and AWS will try to place those instances according to the type of placement group you choose.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the three types of placement groups? Summarize each one.

A

Cluster: Packs instances close together inside an AZ. This optimizes for low-latency communication between instances, at the cost of increased risk of losing multiple instances in an outage. Ideal for clustered high performance computing.

Partition: Your instances are divided into groups called “partitions”. Each partition is hosted on a different hardware rack. Less risk of simultaneous failure (compared to Cluster), while still highly performant. A PPG can optionally have partitions in multiple AZs in the same region.

Spread: No instance shares the same rack. Even less risk of simultaneous failure, at the cost of more performance. Like PPG, can optionally span multiple AZ in the same region. A good option if you have a small number of critical instances that should be kept separate from each other.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

I want to spin up multiple EC2 instances for a Kafka (partitionaware stream-processing platform) cluster. How can I make sure that my instances are lower latency, without risking losing the whole cluster if there’s a hardware failure?

A

Create a “partition” placement group for the instances. Any partition-aware software (hadoop, cassandra, kafka) is a good fit for a PPG.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

I work for Genentech, analyzing biomarker data generated from clinical trials. It’s incredibly computationally complex work done that demands low latency between powerful machines on proprietary software. What type of EC2 instance should I use, and how can I keep latency as low as possible?

A

You’ll want to use a Compute Optimized EC2 instance, and you can use a “cluster” placement group to optimize for performance (over reliability).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is EC2 Hibernate?

A

Saves in-memory state to “hibernate” an EC2 instance for fast booting (no restarting the OS).

Caveats:
The root EBS volume must be encrypted.
RAM must be lesss than 150 GB.
Can’t be hibernated for more than 60 days.
Only for on-demand and reserved instances, and not all instance types support it.

Under the hood, it’s actually writing RAM state to a file in the root EBS volume.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is EC2 Nitro?

A

New virtualization technology for the next generation of EC2 instances. Better performance, better networking options, higher speed EBS, better underlying security. Only later instance generation can support it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can I get higher IOPS for my EC2 instance?

A

Use EC2 Nitro.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is my IOPS limit with Nitro vs without?

A

64k EBS IOPS with it, 32k without.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a vCPU?

A

A virtual CPU. Each vCPU represents a thread.

For example, when you launch an m5.xlarge, you get 4 CPU, 2 threads per CPU, so 8 vCPU total.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a capacity reservation?

A

By creating Capacity Reservations, you ensure that you always have access to EC2 capacity when you need it, for as long as you need it. You can create Capacity Reservations at any time, without entering into a one-year or three-year term commitment, and the capacity is available immediately.

Billing (priced at the same as the EC2 instance cost) starts as soon as the capacity is provisioned and the Capacity Reservation enters the active state. When you no longer need it, cancel the Capacity Reservation to stop incurring charges

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How can I ensure that an AWS instance is available when I need it?

A

Reserved instances are one option, if you expect to use something for 1-3 years.

Alternatively, you can make a capacity reservation. This can be cancelled or made at any time, but it costs the same as running the ec2 instance type (though if you run said instance while you have an open reservation, you only pay once).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Can I use AMIs across regions?

A

No, you need to copy it to another region if you want to use it there.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

If I copy an AMI, will it have the same ID?

A

No, a new ID is created for that copy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How can an EC2 instance programmatically get policy name, AMI ID, security groups, etc.

A

Instance metadata: a static HTTP endpoint it can send requests to, which will return data for that specific instance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly