AWS Cloud Practitioner Study Notes · Part 16
Amazon EC2 Instance Families and Lifecycle States
AWS Cloud Practitioner study notes explaining EC2 instance families, naming, workload selection, lifecycle states, and instance billing.
Choosing an Amazon EC2 instance is easier when you start with the workload bottleneck. Is the application balanced, CPU-bound, memory-bound, storage-bound, or dependent on a GPU or another accelerator? EC2 instance families are designed to make that decision visible in the instance name.
This is Part 16 of the AWS Cloud Practitioner Study Notes series. Part 15 covered EBS volume types; this note focuses on the compute instance attached to that storage.
Read an EC2 instance name
An EC2 instance type usually contains an instance series, a generation number, optional processor or capability suffixes, and a size.
m7g.large
│ │ │
│ │ └── size
│ └───── generation
└─────── family series
For m7g.large:
mis the general-purpose series.7is the generation.gindicates an AWS Graviton processor.largeis the instance size.
The official naming model is slightly broader than “family + generation + size”: the middle portion can contain more than one option. For example, c7gn.xlarge includes g for Graviton and n for enhanced networking. The part after the period is the size, such as small, large, 2xlarge, or metal.
EC2 families at a glance
| Family or series | Optimised for | Typical workloads |
|---|---|---|
| M | General purpose | Web servers, application servers, balanced services |
| T | Burstable general purpose | Development, small services, workloads with variable CPU demand |
| C | Compute | Batch processing, high-performance web servers, scientific workloads |
| R, X, Z, U | Memory | In-memory databases, large databases, real-time analytics |
| I, D, H | Storage | NoSQL databases, search, data processing, local storage I/O |
| P | GPU compute | Deep learning training and high-performance GPU computing |
| G | Graphics and visualisation | 3D graphics, rendering, virtual workstations |
| Inf, Trn | Purpose-built ML acceleration | Inference and machine-learning training |
| F | FPGA acceleration | Specialised hardware acceleration |
AWS also provides High Performance Computing (HPC) families for specialised large-scale simulations and other tightly coupled compute workloads. You do not need to memorise every current family for the Cloud Practitioner exam; identify the resource the workload needs first.
General Purpose: M and T families
M family: balanced resources
M instances provide a balance of compute, memory, and networking resources. They are a sensible starting point when no single resource is the obvious bottleneck.
Common use cases include:
- Web and application servers
- Small or medium databases
- Backend APIs
- Code repositories
- Development and test environments
If a question describes a general application that needs balanced CPU and memory, choose the M family.
T family: burstable performance
T instances are also general-purpose, but they provide a baseline level of CPU performance and can burst above that baseline when required. CPU credits govern the burst behaviour.
They can suit workloads such as small web servers, microservices, development environments, and applications with variable CPU demand. T is a useful distinction when the question emphasises a low average CPU load with occasional spikes rather than continuously high CPU usage.
The simple exam difference is:
- M: balanced, steady general-purpose resources.
- T: general purpose with burstable CPU performance.
Compute Optimized: C family
C instances provide more compute capacity relative to memory and are designed for compute-intensive applications. Choose this family when CPU processing is the limiting factor.
Typical examples include:
- Batch processing
- High-performance web servers
- Video encoding
- Scientific modelling
- Dedicated gaming servers
- High-performance computing tasks
- Machine-learning inference
For example, a service performing millions of calculations may need C instances because CPU time—not memory capacity—is the bottleneck.
Exam clues include “CPU-intensive,” “compute-intensive,” “high-performance processors,” and “batch processing.” These point to the C family.
Memory Optimized: R, X, Z, and U families
Memory-optimised instances are designed for workloads that process large datasets in memory. They are useful when keeping data in RAM reduces latency or when the dataset is too large for a normal general-purpose instance.
Common workloads include:
- In-memory databases such as Redis and Memcached
- Large relational databases
- SAP HANA
- Real-time analytics
- Data processing that needs a large memory footprint
The R family is the most familiar Cloud Practitioner answer for memory-intensive workloads. X, Z, and U families serve more specialised high-memory or high-frequency use cases, but the question’s wording should determine the answer.
If the requirement says “large RAM,” “in-memory database,” “cache,” or “memory-intensive analytics,” think Memory Optimized, especially the R family.
Storage Optimized: I, D, and H families
Storage-optimised instances are designed for workloads that need high local storage performance or large local datasets. They are commonly associated with local NVMe storage, high sequential throughput, or high rates of local I/O, depending on the series.
Typical examples include:
- NoSQL databases
- Elasticsearch or OpenSearch clusters
- Data warehousing
- Log processing
- Large-scale data processing
The family letters provide useful clues:
- I: storage-optimised instances for high-performance local storage and I/O-intensive workloads.
- D: dense-storage instances with large local storage capacity.
- H: storage-oriented instances for high-throughput workloads.
Do not confuse local instance storage with Amazon EBS. An instance family can include local instance-store devices, while EBS is persistent network-attached block storage. If the question asks specifically for persistent block storage attached to EC2, review Part 15. If it emphasises very high local storage throughput or capacity, consider a storage-optimised instance.
Accelerated Computing: P, G, Inf, Trn, and F
Accelerated-computing instances use specialised hardware to perform certain operations more efficiently than a general CPU.
P: GPU compute and AI training
P instances are GPU-accelerated and are commonly used for deep-learning training, high-performance GPU computing, and large parallel workloads.
Exam keywords include:
- Train a neural network
- Deep learning
- GPU computation
- Large-scale model training
These clues point to the P family.
G: graphics and visualisation
G instances are designed for graphics-intensive workloads such as 3D rendering, visualisation, video production, and virtual workstations for designers.
If the requirement is a virtual desktop with 3D graphics rather than model training, the G family is the more natural answer.
Inf and Trn: purpose-built machine learning
AWS Inferentia instances use the Inf series for machine-learning inference. AWS Trainium instances use the Trn series for machine-learning training. These families are specialised alternatives to general GPU instances.
For a foundational exam question, the broader answer may simply be Accelerated Computing. When the question names inference or Trainium directly, use the corresponding family.
F: FPGA acceleration
F instances use Field Programmable Gate Arrays (FPGAs) for specialised hardware acceleration. They are less common in introductory scenarios, but belong to the Accelerated Computing category.
Generation, processor, and size
Generation
The generation number generally indicates a newer hardware design. For example, a newer M generation may offer improved performance or price-performance compared with an older generation, although the exact result depends on the processor and configuration.
When comparing generations, check:
- Supported AWS Region
- Processor architecture
- vCPU and memory configuration
- Network and EBS bandwidth
- Operating-system and application compatibility
- Current pricing
Processor and capability suffixes
Common suffixes include:
| Suffix | Meaning |
|---|---|
g | AWS Graviton processor |
i | Intel processor |
a | AMD processor |
d | Instance-store volumes or additional local storage, depending on family |
n | Enhanced networking and often enhanced EBS capability |
The suffix does not replace workload selection. First choose the family; then compare processor architecture and capabilities.
Size
Within a family, sizes such as large, xlarge, 2xlarge, and 4xlarge provide different combinations of vCPUs, memory, networking, and sometimes storage capacity. Larger sizes generally provide more resources and cost more, but exact ratios vary by family.
Choose a size through measurement and right-sizing rather than assuming the largest option is best. CPU utilisation, memory pressure, network throughput, EBS performance, and application latency are useful signals.
Common CLF-C02 exam cues
- Balanced web or application server: M, General Purpose
- Variable CPU demand with bursts: T, Burstable Performance
- CPU-intensive calculations or batch processing: C, Compute Optimized
- Redis, Memcached, SAP HANA, or large in-memory dataset: R or Memory Optimized
- High local storage I/O or large local dataset: I, D, or Storage Optimized
- Deep-learning model training: P or Accelerated Computing
- 3D graphics or virtual workstation: G or Accelerated Computing
- Machine-learning inference using AWS Inferentia: Inf
- Machine-learning training using AWS Trainium: Trn
The strongest clue is usually the bottleneck: CPU, memory, storage, graphics, or specialised ML acceleration.
EC2 instance lifecycle states
An EC2 instance also moves through lifecycle states from launch to termination. Understanding these states helps you reason about availability, data persistence, and instance usage billing.
| Instance state or transition | What it means | Instance usage billing |
|---|---|---|
pending | The instance is preparing to enter running, either after launch or after starting from stopped. | Not billed |
running | The instance is ready for use. | Billed |
rebooting | The operating system is restarting while the instance remains available as the same instance. | Billed; rebooting does not start a new billing period |
stopping | The instance is preparing to stop. | Not billed for a normal stop; hibernation is billed while it is stopping |
stopped | The instance is shut down and can be started again. | Not billed for instance usage |
shutting-down | The instance is preparing to be terminated. | Not billed |
terminated | The instance has been permanently deleted and cannot be started. | Not billed |
AWS’s API exposes six primary instance state values: pending, running, stopping, stopped, shutting-down, and terminated. “Rebooting” and “stop-hibernated” are useful operational descriptions, but hibernation finishes in the stopped state rather than creating a separate permanent API state.
The main state flows
The common transitions are:
- Launch or start:
pending→running - Stop and start:
running→stopping→stopped→pending→running - Reboot:
running→running - Hibernate:
running→stopping→stopped, with RAM saved to EBS - Terminate:
running→shutting-down→terminated
There are two important differences between stopping, rebooting, and terminating:
- Reboot: restarts the operating system. The instance remains on the same host in the normal case, keeps its private IPv4 address, and instance usage continues to be billed.
- Stop and start: shuts down an EBS-backed instance and later starts it again. Instance usage is not billed while it is stopped, but EBS volumes and other attached resources can continue to incur charges.
- Terminate: permanently deletes the instance. You cannot start or recover the terminated instance, so preserve required data in EBS volumes, snapshots, or another backup before terminating it.
Stopped versus hibernated
Normal stopping discards the contents of RAM. Hibernation saves the contents of memory to the EBS root volume before the instance enters the stopped state. When the instance starts again, the operating system and applications can resume from the saved state instead of performing a normal boot.
Hibernation requires an EBS-backed instance and must meet AWS hibernation prerequisites. It is not the same as a normal stop, and AWS bills instance usage while the hibernation operation is in the stopping state. Once hibernated and in stopped, instance usage is no longer billed, but EBS storage—including the saved RAM contents—continues to incur storage charges.
Billing reminders
The lifecycle state controls EC2 instance usage billing, not every charge associated with the workload:
runningis the main state where instance usage is billed.- A normally
stoppedinstance does not incur instance usage or data-transfer charges. - EBS volumes continue to incur storage charges while the instance is stopped.
- Elastic IP addresses and other associated resources can have their own pricing rules.
- A terminated instance stops incurring instance usage charges when it enters
shutting-down, but Reserved Instance commitments can continue according to their terms.
For a cost-saving question, stopping an EBS-backed development instance overnight is different from terminating it. Stopping preserves the instance configuration and EBS-backed data for a later start. Terminating removes the instance permanently and may delete the root volume according to its DeleteOnTermination setting.
Lifecycle exam cues
- Preparing to run:
pending - Ready and being used:
running - Temporary restart: reboot; the instance remains billed
- Temporarily shut down and restartable:
stopped - Saving RAM before shutdown: hibernation, which ends in
stopped - Permanently deleted:
terminated - No instance usage charge while normally stopped: check for continuing EBS and other resource charges
Conclusion
An EC2 instance name contains useful information, but the workload should drive the selection. Start with the family: M or T for general purpose, C for CPU, R and related families for memory, I/D/H for storage, and P/G/Inf/Trn/F for accelerated computing. Then compare generation, processor options, size, network capacity, EBS bandwidth, compatibility, and price.
The lifecycle is the second part of the decision. Know whether an instance is running, stopped, hibernated, rebooting, or terminated, and separate instance usage charges from EBS and other resource charges.
For the exam, remember the simple mapping: M means balanced, C means compute, R means RAM, storage families mean local disk, and accelerated families mean specialised hardware.