EC2 Instance Types
This section covers Amazon EC2 instance types and how to choose the best one for a given use case.
Instance Type Configurations
- Each instance type defines a configuration of CPU, memory, storage, and network performance.
- Larger instance types generally have higher values for these characteristics.
- Example:
- Moving from large to extra-large to 8x-large instances increases CPU, memory, and storage.
- Network performance may be more static across sizes compared to other characteristics.
Choosing the Right Instance Type
- Consider workload, performance needs, and cost requirements.
- Understand the naming convention to identify instance types.
Naming Convention
An instance type name consists of several parts:
- Instance Type Family: Indicates the type of workload the instance is designed for (e.g., compute-optimized).
- Generation: Represents the generation of the instance type.
- Processor Family: Specifies the processor used (e.g., Graviton).
- Additional Capabilities: Indicates additional features such as network or EBS optimization.
- Size: Specifies the size of the instance (e.g., xlarge).
- Example:
c7gn.xlarge
c
: Family name (Compute Optimized)7
: Seventh generationg
: Graviton processorn
: Network and EBS optimizedxlarge
: Extra large size
Instance Families
General Purpose:
- Balance of compute, memory, and networking resources.
- Use cases: web/application servers, enterprise applications, dev/test environments.
Compute Optimized:
- High-performance processors for compute-bound applications.
- Use cases: batch processing, distributed analytics, multiplayer gaming.
Storage Optimized:
- High sequential read/write access to large datasets on local storage.
- Use cases: high-performance databases, real-time analytics, log processing.
Memory Optimized:
- Fast performance for processing large datasets in memory.
- Use cases: in-memory caches, high-performance databases, big data analytics.
Accelerated Computing:
- Hardware accelerators for floating-point calculations, graphics processing, and data pattern matching.
- Use cases: machine learning, artificial intelligence, graphics workloads.
High Performance Computing (HPC):
- Best price/performance for running HPC workloads at scale.
- Use cases: complex simulations, deep learning.
Optimizing Instance Choice
- Select an instance type that provides the necessary performance while minimizing cost.
- Choose the latest generation in your chosen instance family for better price-to-performance.
EC2 Instance Types Page:
- Use the instance types page in the AWS console to choose a new instance.
- Offers search and filter capabilities.
AWS Compute Optimizer:
- Use AWS Compute Optimizer to get recommendations on optimizing existing instances.
- Analyzes EC2 instances and Auto Scaling groups.
- Generates recommendations to reduce cost and improve performance.
Key Takeaways
- An EC2 instance type defines CPU, memory, storage, and network performance.
- Choose newer generation instance types for better price/performance.
- Use the EC2 console and AWS Compute Optimizer to find the right instance type.