Study Guide965 words

Mastering AWS EC2: Instance Families, Sizing, and Optimization

Instance families and use cases

Mastering AWS EC2: Instance Families, Sizing, and Optimization

This guide covers the selection and management of Amazon EC2 instance families to meet specific performance and cost objectives, as required for the AWS Certified Solutions Architect - Professional (SAP-C02) exam.

Learning Objectives

  • Identify the primary EC2 instance families and their specific workload optimizations.
  • Interpret instance naming conventions, including generation indicators and feature suffixes.
  • Evaluate processor choices (Intel, AMD, Graviton) based on cost and architecture compatibility.
  • Apply rightsizing methodologies using CloudWatch metrics and iterative testing.
  • Distinguish between modern pricing models like Savings Plans and traditional Reserved Instances.

Key Terms & Glossary

  • Instance Family: A grouping of instances optimized for specific resource types (e.g., Compute, Memory).
  • Burstable Performance (T Family): Instances that provide a baseline level of CPU performance with the ability to burst above that baseline when needed.
  • Graviton: AWS-designed ARM-based processors that offer high performance-to-price ratios for compatible workloads.
  • Rightsizing: The process of matching instance types and sizes to your workload performance and capacity requirements at the lowest possible cost.
  • Tenancy: Defines how EC2 instances are distributed on physical hardware (Shared, Dedicated Instance, or Dedicated Host).

The "Big Idea"

Selecting the right EC2 instance is not a "set and forget" task; it is an iterative process of observation and refinement. Because the cloud offers elasticity, the goal is to start with a best-guess (typically General Purpose), monitor utilization metrics (CPU, Memory, Network, Disk), and then migrate to the optimal family and size. This approach ensures you are neither over-provisioning (wasting money) nor under-provisioning (impacting performance).

Formula / Concept Box

EC2 Naming Convention

The naming of an instance follows a structured pattern that reveals its capabilities:

ComponentExampleMeaning
FamilymGeneral Purpose
Generation66th Generation (higher = newer/better)
ProcessorgGraviton (ARM); i = Intel; a = AMD
SubtypedLocal NVMe SSD storage included; n = extra network bandwidth
SizelargeThe "T-shirt size" (determines vCPU, RAM, Bandwidth)

[!IMPORTANT] Full String Example: m6gd.large is a 6th Generation General Purpose instance, powered by Graviton, with local SSD storage, sized "large".

Hierarchical Outline

  • I. Primary Instance Families
    • General Purpose (M, T): Balanced resources for web servers and small databases.
    • Compute Optimized (C): High-performance processors for batch processing and gaming.
    • Memory Optimized (R, X, Z): High RAM for in-memory databases and big data analytics.
    • Storage Optimized (D, I): High sequential read/write and low-latency local NVMe.
    • Accelerated Computing (P, G, F): Hardware accelerators for ML, graphics, and FPGAs.
  • II. Processor Architectures
    • x86 (Intel/AMD): Broadest compatibility; AMD is often a cost-efficient alternative to Intel.
    • ARM (Graviton): Best price-performance; requires re-compilation of binaries and dependency checks.
  • III. Optimization & Rightsizing
    • CloudWatch Metrics: Monitoring CPUUtilization, MemoryUtilization, NetworkIn/Out.
    • Elasticity: Using Auto Scaling to scale out (more instances) rather than just scaling up (larger instances).

Visual Anchors

Instance Selection Decision Tree

Loading Diagram...

Processor Choice Comparison

\begin{tikzpicture}[node distance=2cm] \draw[thick, <->] (0,4) node[above]{High Performance} -- (0,0) node[below]{Standard Performance}; \draw[thick, <->] (0,0) -- (6,0) node[right]{High Compatibility (x86)};

code
\node[draw, circle, fill=blue!20] at (5,3) {Intel (i)}; \node[draw, circle, fill=green!20] at (4.5,1.5) {AMD (a)}; \node[draw, circle, fill=orange!20] at (1.5,3.5) {Graviton (g)}; \node[text width=3cm, font=\footnotesize] at (5, -1) {Maximum Software Compatibility (Legacy Apps)}; \node[text width=3cm, font=\footnotesize] at (1.5, -1) {Best Price-Performance (Requires ARM Porting)};

\end{tikzpicture}

Definition-Example Pairs

  • Burstable Instance (T Family): An instance that operates at a baseline but can handle spikes.
    • Example: A microservice that handles low traffic most of the day but experiences a 10-minute surge during morning logins.
  • Storage Optimized (I Family): Instances designed for workloads requiring high, sequential read/write access to large datasets on local storage.
    • Example: A NoSQL database like Cassandra or MongoDB that needs extremely low latency local NVMe SSDs.
  • Instance Variants (n subtype): Subtypes offering significantly higher network throughput.
    • Example: A C5n.4xlarge used for a High-Performance Computing (HPC) node requiring 100 Gbps networking.

Worked Examples

Example 1: Web Application with Spiky Demand

Scenario: A company hosts a internal reporting tool used mainly between 8 AM and 9 AM. Problem: During the day, the CPU usage is 5%, but at 8 AM it hits 90%. Solution: Use a T3 instance. It provides a low-cost baseline and accumulates "CPU Credits" during the idle hours, which are spent during the 8 AM burst.

Example 2: Migrating for Cost Efficiency

Scenario: A Fleet of m5.large (Intel) instances is running at 40% CPU utilization. Requirement: Reduce costs without changing the application logic significantly. Solution: Evaluate m5a.large (AMD). Since both use the x86 chipset, no code changes are needed, and AMD instances typically offer a ~10% cost saving over Intel.

Checkpoint Questions

  1. Which instance family should you choose for an in-memory database requiring 512 GiB of RAM?
  2. What is the main requirement for moving a workload from an m6i to an m6g instance?
  3. True or False: Savings Plans can be applied to Lambda and Fargate, whereas standard Reserved Instances are generally tied to EC2 families.
  4. What does the d suffix signify in an instance type like r5d.xlarge?
Click to see answers
  1. R, X, or Z Family (specifically X or R depending on the exact RAM ratio).
  2. ARM Compatibility: The application and its dependencies must be compatible with the ARM architecture.
  3. True: Savings Plans offer significantly more flexibility across compute services.
  4. Local Storage: It indicates the instance includes local NVMe SSD storage.

Muddy Points & Cross-Refs

  • Graviton Porting: Many users forget that Graviton isn't just a "switch." You must verify that your Docker images are multi-arch or built for ARM.
  • Savings Plans vs. RIs: While RIs still exist, Compute Savings Plans are the preferred choice for most modern architectures because they automatically apply to any instance family, even if you switch from C to M mid-term.
  • Instance Subtypes: n (Network) vs d (Disk) — sometimes you need both (e.g., dn suffix).

Comparison Tables

Comparison of Common Instance Families

FamilyNameOptimizationCommon Use Case
MGeneral PurposeBalanced CPU/RAMApplication servers, small DBs
CComputeHigh CPU:RAM ratioMedia encoding, Batch processing
RMemoryHigh RAM:CPU ratioIn-memory caches (Redis), SQL DBs
I/DStorageHigh I/O / ThroughputData warehousing, Log processing
TBurstableCost-effective baselineDev environments, Low-traffic web
G/PAcceleratedGPU-basedML training/inference, Video rendering

[!TIP] When in doubt for the exam, remember: "R is for RAM", "C is for Compute", and "M is for Medium/Middle (General)".

Ready to study AWS Certified Solutions Architect - Professional (SAP-C02)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free