EC2 Flashcards

1
Q

What is EC2?

A

A web service that provides secure, resizable compute capacity in the cloud

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

What’s the difference between a public and private IP address?

How does a private IP connect to the web?

What must be defined for a private IP?

How can you connect to a private IP?

A

A public IP must be unique on the web. A private IP must be unique within your VPC.

A private IP uses a NAT to connect to the web.

A private IP must have defined range

You must be connected to the private network via a VPN.

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

When would you use an elastic IP?

What should you typically do instead of using an elastic IP?

A

You would use an elastic IP to connect directly to connect a static IP address up to an EC2 instance. However, this is bad practice. Instead the DNS name should be used or a load balancer should expose the instance to the web and connect to the EC2 instance via a private IP

The DNS name should be used or a load balancer should expose the instance to the web and connect to the EC2 instance via a private IP

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

Which IP version does elastic IP use?

How many EC2 instances can an elastic IP be attached to at a time?

A

IPv4

1

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

What happens to the public IP address of an EC2 instance when it is restarted?

A

It can change.

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

What is a spot instance?

A

Compute that can be requested on demand with up to a 90% discount.

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

How does pricing work for an EC2 Spot instance?

What happens when you go over the max price threshold?

What two variables does the hourly price depend on?

What happens if the current spot price goes over your max price?

What are the types of requests available of spot instances?

How would you terminate a persistent spot request?

A

Define max spot price and get the instance while current spot price < max

You lose the spot instance when price goes over the max

Hourly spot price varies based on demand/availability

If the current spot price > your max price you can choose to stop or terminate you instance with a 2 minutes grace period

One time or persistent.

To terminate spot requests, you must first cancel your request, then terminate your instances.

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

What is a spot block instance?

Can the spot block instance be interrupted?

A

Spot blocks (Fixed duration instances) are designed not to be interrupted and will run continuously for the duration you select, even if the spot market price goes above your threshold.

In rare situations, Spot blocks may be interrupted due to Amazon Web Services capacity needs. In these cases, we will provide a two-minute warning before we terminate your instance (termination notice), and you will not be charged for the affected instance(s).

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

What is a spot fleet

How do you define a spot fleet launch pool?

When does a spot fleet stop launching instances?

What are the 3 strategies to allocate spot instances in a fleet and when would you use each?

A

Set of Spot Instances + (Optional) On-Demand Instances that will will try to meet the target capacity with price constraints

Pools are defined with instance types, OS and AZ. There can be multiple pools.

When the capacity or max cost is reached.

Lowest prices - Use for small jobs where the likelihood of interruption is low

Diversified - (The Spot Instances are distributed across all Spot capacity pools.) If your fleet is large or runs for a long time, you can improve the availability of your fleet by distributing the Spot Instances across multiple pools using the diversified strategy

Capacity - (pool with optimal number of instances). strategy for workloads where the possibility of disruption must be minimized because restarting the job would be expensive and the preference for certain instance types matters.

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

What is a placement group?

What are the types of placement groups and what are they good for?

A

A placement group gives you control over the EC2 Instance placement strategy.

Cluster - Cluster instances into a low latency group in a single AZ. Same rack. High failure risk
Useful for big data jobs that need to complete fast
Application that needs extremely low latency and high network throughput

Spread - Spreads instances across underlying hardware (max 7 instances per group per AZ) - Used to minimize the failure risk.
Critical applications
Minimize failure risk
Spans across AZs
Limit to how big your placement group can be (7 instances per AZ)

Partition - Spreads instances across many different partitions (Which rely on different sets of racks) within an AZ. Scales to 100s of EC2 instances per group
A partition failure won’t affect other partitions
Big data applications that are partition aware Hadoop, Cassandra, Kafka

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

What is an Elastic Network Interface (ENI)?

A

Represents a virtual network card

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

What are the 5 most important attributes that an ENI can have?

PEPSM

A
Has primary private IPv4 and one or more secondary IPv4
One elastic IP
One public IP
One or more security groups
A mac address
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How does attaching and detaching work?

Is an ENI bound to an AZ?

A
  • You can create an ENI independently and attach them on the fly for failover
  • Bound to a specific AZ
  • Gives you more control than an automatically created network interface because they won’t be deleted when an instance is terminated

Yes

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

What happens when an EC2 instance is hibernated?

What are 2 use cases for EC2 instance hibernation?

What are the instance families that support hibernation?

How long can an instance be hibernated for?

A

OS is not stopped or restarted
The in-memory ram is preserved by writing it to an encrypted ESB

Allow long-running processing to continue running
Services that take a long time to initialize

General Purpose SSD (gp2 and gp3) or Provisioned IOPS SSD (io1 and io2).

60 Days

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

What is EC2 Nitro?

Why would you need EC2 Nitro?

A

Underlying Platform for the next gen or EC2 Instances.

Allows for better performance (64k EBS IOPS vs 32k). It also has better underlying security

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

What is a vCPU?

How can the vCPU options be modified?

When can vCPU options be modified?

A

A CPU can have multiple threads, each thread is a vCPU. Typically AWS has 2 vCPUs per core.

You set the number of cores you want for an instance type. For instance if you chose an instance type for more memory and don’t really need all of the computing power, you can decrease the number of cores that are provisioned. This can save you memory. You can also change the number of vCPUs per core from 2 to 1. This is useful for high performance scenarios.

At config time.

17
Q

What is an EC2 Capacity reservation and when would you use it?

A

If you need to plan in advance for capacity and make sure you can launch instances in an AZ of a specific type around a specific timeframe, then use EC2 capacity reservations

Short term reservation - specify end date (Don’t need to commit for 1or 3 years)

18
Q

If you want to Scales to 100s of EC2 instances per group to support Big data applications that are partition aware Hadoop, Cassandra, Kafka what type of placement group would you use?

A

Partitioned.

19
Q

What is an EC2 Scheduled Reserved Instance?

What is an EC2 Scheduled Convertible Instance?

Scheduled reserved

Dedicated host

Dedicated instances

A

Allows you to reserve for 1 year. Must reserve a specific type

Long work loads with flexible instances (You can change the type)

(Every Tuesday from 3-6pm)

Book an entire physical server.
Use eligible/existing license eligible software licenses Helps meet compliance requirements
Access to underlying hardware

Dedicated physical server
Per instance billing as oppose to per rack
No accesses to underlying hardware.
Not good for licenses