Section 5/6: EC2 Fundamentals & Solutions Architecture Flashcards
What are the four EC2 pricing models?
1) On demand
2) Reserved
3) Spot
4) Dedicated host
Cheapest EC2 pricing?
Spot instances (up to 90% discount)
EC2 Spot Instance use cases
Stateless workloads resilient to failures like big data / data analysis
What are EC2 Spot Instances?
Bidding on capacity that isn’t being used & can be kicked off if someone bids higher.
Define the max spot price and get the instance when current spot price is below your max spot price.
What are spot instances not good for?
DBs, critical jobs or any persistent workloads
What are the four types of EC2 instances?
1) general purpose
2) Compute optimized
3) Memory Optimized
4) Storage optimized
Why use a General purpose EC2 instance?
- Diversity of workloads (web servers / code repos)
- Balance between compute, memory, networking
Why use a Compute Optimized EC2 instance?
- great for compute intensive tasks
- high performance computing, ML, modeling
Why use a Memory Optimized EC2 instance?
- For storage intensive tasks
- Databases, data warehousing, caching
What are the two types of spot fleet termination requests?
1) One-time request
2) Persistent Request
What is a one-time Spot Fleet termination request?
If current spot price > max price you can choose to stop or terminate instance with a 2 minute grace period
Persistent request
What is a persistent-request Spot Fleet Termination Request?
Terminate instance, but as soon as the spot price goes back below your spot price, the instance is going to get relaunched
Identifying devices using a Public vs Private IP?
Public IPs are used to identify a device outside a network.
Private IPs are used to identify a device within a local network.
IPv4 vs IPv6?
IPv4 is older and running out of addresses. IPv6 is newer and solves problems of IPv4
When you stop and start an EC2, what happens to it’s IP address?
The EC2 instance’s public IP address can change
What is an Elastic IP, and when would we use it?
An Elastic IP is a public IPv4 you own as long as you don’t delete it, and can only be attached to one instance at a time. use an Elastic IP if you want to assign a fixed public IP for your instance.
Should you try to avoid using Elastic IP?
Yes, because:
Reflects poor architectural decisions,
Better to use a random public IP and register a DNS name to it,
Or ever better use a Load Balancer and don’t use a public IP
What is an ENI?
Elastic Network Interface, a virtual netowrk card that automatically attaches to EC2s. Allows primary private IPv4 addresses from address ranges of a VPC. Basic networking.
Why use an ENI (elastic network interface) with ENA?
Enhanced networking. ENI’s provide high performance networking capabilities, and should be used when you want good network performance for no additional charge & its available.
What is an Elastic Fabric Adapter?
Network device to accelerate High Performance Computing (HPC) and ML operations
What are the 3 EC2 Placement Group types?
1) Clustered
2) Spread
3) Partitioned
Clustered EC2 placement group: Pros, Cons, Use cases?
Pro: great networking
cons: If the group fails, all instances fail, all instances in singe AZ
Use Cases: 1) Low Network Latency (high network performance)
2) Big data jobs that need to be done quickly
3) Recommended for homogenous instance types
Spread EC2 Placement group: Pro’s, Con’s, Use Cases?
Pros: great for critical apps, as each EC2 is placed on distinct underlying physical hardware. Can spam across AZ, reduces risk of simultaneous failure
Cons: Can only run 7 instances per AZ
Use Cases: For apps with small number of critical instances that need to be kept separate, and maximize availability
Partitioned EC2 Placement group: Pro’s, Con’s, Use Cases?
Pros: good for distributed apps, as groups are divided into logical segments. Can span multiple AZs in the same region, with 100s of EC2s. Partition failures can affet many EC2s, but not all (isolate hardware failure)
Use Cases: Services that can be partitioned like Cassandra
Explain the two EC2 Hibernate options
1) Can stop instances (keeping data intact until next start)
2) Can terminate instances, so any EBS volumes set-up to be destroyed are lost.
EC2 Hibernate Limitations
1) Can’t hibernate for more than 60 days
2) Instance RAM must be < 150 GB
3) Can’t hibernate instances in ASG or ECS, doesn’t support all EC2 instance families / AMIs
What does an EC2 instance retain from hibernation?
1) Instance ID
2) Private IPv4 Address & all IPv6 Addresses
3) Elastic IPs
EC2 Hibernate is..? Use cases?
Hibernate is basically the same as a regular computer hibernating. Use case: Saving Ram State, as hibernate is good for long-running processes that take long to initialize.
What is EC2 Nitro, and what does it provide?
Nitro is a new virtualization technology for the next generation of EC2. Provides better performance for EBS, networking, and better underlying security
How do you optimize EC2 CPU?
Increase the number of CPU cores and the number of threads per core (1 thread per CPU is useful for HPC workloads)
What is EBS?
Elastic Block Storage.
Persistent block storage attached to EC2 instances while they run. Allows instances to persist data even after termination.
EBS (elastic block storage) analogy
EBS volumes are “network USB sticks”, not physical drives. They use the netwrok to communicate with the instance, so latency is possible
EBS properties
1) Volumes are always in the same AZ as EC2 instance
2) Root EBS volume deleted with instance
3) Can detach volumes as additional disk, without stopping instance.