Please enable JavaScript.
Coggle requires JavaScript to display documents.
EC2 - Coggle Diagram
EC2
EC2 instance types
t/ m: General Purpose
Features:
- Diversity of workloads
- Balance between compute, memory, networking
-
c: Compute Optimized
Features:
- Compute-intensive tasks
- Batching processing, media transcoding, High performance web server, HPC, scientific modeling & machine learning, dedicated gaming server
r: Memory Optimized
Features:
- Fast performance data set processing in memory
- High performance relational/ non-relational databases, distributed web scale cache stores, In-memory databases optimized for BI, application performing real-time processing of big unstructured data
-
-
-
-
-
Purchasing options
On-Demand
Features:
- Short-term & uninterrupted workload
- Predictable pricing (Linux bill per second after the first minute, ex. Windows other bill per hour)
- Highest cost
- No upfront/ long-term commitment
Reserved
(Min. 1 year)
Reserved Instances
Features:
- Long workload
- Up to 75% discount
- Commit 1 or 3 years
- Higher reserve period = +++ discount
- No Upfront/ Partial upfront
- All upfront = +++ discount
- Uninterruptible
Convertible Reserved Instances:
- Long workload
- Can change EC2 instance type
- Up to 54% discount
Scheduled Reserved Instances:
- e.g. Every Friday between 8 - 12pm
- Commit over 1 to 3 years
Spot Instances
Features:
- Not suitable for critical jobs (e.g. Batch jobs, data analysis, image processing)
- Short workload
- Up to 90% discount
- Interruptible if max price is less than current spot price
- Stop or Terminate instance with a 2 mins grace period when current spot price < my max price
-
Spot Instance request
Request type:
- One-time
- Persistent
Spot Block
Features:
- Block a Spot Instance for a specified timeframe
(e.g. 1 to 6 hours)
- Do not want Spot Instance to be reclaimed by AWS
Spot Fleets
-
Features:
- Set of Spot Instances + (optional) On-Demand Instances
- Try to meet target capacity with price constraints
- Define multiple launch pools (i.e. different instance type, OS, AZ)
- Fleet can choose launch pools
- Fleet stops launching instances when reaching capacity or max cost
Dedicated Hosts
Features:
- Address compliance requirement
- Reduce costs by allowing you to BYOLicense
- 3 years period reservation
- Most expensive
-
EC2 vCPU
Features:
- Core = CPU
- Multithreading: Multiple threads can run on 1 CPU
- Each thread = 1 vCPU
-
Optimizing CPU options:
- Change # of CPU cores (lower number of CPU to decrease licensing costs)
- Change # of threads per core (disable multithreading to have 1 thread per CPU, helpful in HPC workload)
Attributes specify CPU options during instance launch:
- Core count
- Threads per core
EC2 Instance Store
-
Cons:
- EC2 Instance Store lose their storage if it is stopped (ephemeral)
- Risk of data lose if hardware fails
- Backups and Replication are Customer's responsibility
User case:
- Good for buffer/ cache/ scratch data/ temporary content
- Higher performance compared to EBS
EC2 Placement Group:
- How do we want the EC2 instances to be placed compare 1 to another ?
Cluster
Features: (image)
- Same Rack, Same AZ
- Pro: Low latency 10Gbps network
- Cons: All instances fails at the same time if rack fails
- Use Cases: Application that needs extremely low latency and high network throughput
-
Spread
Features: (image)
- Span across AZs, Multi-hardware per AZ, EC2 instances are on different physical hardware
- Pro: Reduced risk of simultaneous failure
- Cons: Limited to 7 instances per AZ per placement group
- Use Cases:
- Application that needs to maximize HA
- Critical application where each instance must be isolated from failure from each other
-
Partition
-
Features: (image)
- Span across multi-AZs in the same region, Multi-partitions per AZ, Multi-instances per partition
- Up to 7 partitions per AZ
- Up to 100s of EC2 instances
- EC2 instance get access to the partition information as metadata
- Pro: Partition failure won't affect other partitions
- Use Cases:
- Distributed application
- HDFS, HBase, Cassandra, Kafka
EC2 Hibernate
Features: (image)
- In-memory (RAM) state is preserved
- RAM state is written to a file in the root EBS volume
- Root EBS volume must be encrypted
- Instance boot much faster
User cases:
- Long-running processing
- Saving RAM state
- Services that take time to initialize
-
EC2 Nitro
Features:
- New virtualization technology
- Better underlying security
Better performance:
- Better networking options
- High performance computing (HPC), IPV6
- Higher speed EBS
- Nitro: 64,000 EBS IOPsecs
- Non-nitro: 32,000 EBS IOPsecs
-
EC2 instance state
Started, Stopped, Terminated
-
EC2 Meta Data
Features:
- Allows information to be extracted about the EC2 instances without using an IAM Role for that purpose
- Can retrieve the IAM Role name from the EC2 Metadata
- Cannot retrieve IAM Policy from the EC2 Metadata
- URL is http://169.254.169.254/latest/meta-data
-
1 Public IPv6:
- Can change after EC2 instance stopped and started
- WWW
1 Private IPv4:
- Internal AWS network
Highly Available EC2 Instances Architecture:
- Creating a highly available EC2 instance (image x 2)
- Creating highly available EC2 instance with ASG (image x 2)
- Creating highly available EC2 instance with ASG + EBS (image x 2)