EC2 & Compute
AWS SAA SAA-C03 · Design High-Performing Architectures
EC2: virtual servers in the cloud
Amazon Elastic Compute Cloud (EC2) provides virtual servers — instances — that you can launch in minutes, in sizes ranging from a single virtual CPU to machines with hundreds of vCPUs and terabytes of memory. You choose an Amazon Machine Image (AMI) as the starting point: the operating system plus any preinstalled software. AWS provides AMIs for common operating systems, the AWS Marketplace offers third-party images, and you can create your own custom AMIs from a configured instance. An AMI is Regional, but you can copy it to other Regions, which matters for disaster recovery and multi-Region deployments.
Instances run in a VPC subnet, get their permissions from an IAM role, and store data on EBS volumes or instance store volumes. When you stop an instance, its EBS-backed root volume persists and the instance can be restarted later; when you terminate it, the root volume is deleted by default. This distinction shows up in exam questions about cost: stopping instances you do not need is a legitimate way to stop paying for compute while keeping the data.
Choosing an instance family
EC2 instance types are grouped into families by what they are good at, and the exam expects you to match the family to the workload. General purpose (T and M families) balance CPU, memory, and networking for everyday workloads like web servers. Compute optimized (C family) offers a high ratio of CPU to memory for batch processing, media transcoding, and scientific computing. Memory optimized (R and X families) provides large amounts of RAM for in-memory databases and caches. Storage optimized (I and D families) offers high-throughput local storage for data warehousing and distributed file systems. Accelerated computing (P, G, and Inf families) adds GPUs or specialized chips for machine learning and graphics.
The T family deserves special attention because it uses burstable performance: T instances accumulate CPU credits while idle and spend them when they need to burst above a baseline level of CPU. They are cheap and ideal for workloads that are idle most of the time with occasional spikes — a small website, a development server, a microservice. They are a poor choice for sustained high CPU, because once the credits run out the instance is throttled to its baseline. The exam likes to test this: a workload with consistently high CPU on a T instance is a misconfiguration, and the fix is a different family, not a bigger T.
Purchasing options: the cost lever
How you pay for EC2 is one of the biggest cost decisions in any architecture, and a favorite exam topic. On-Demand instances are pay-as-you-go with no commitment: the most flexible and the most expensive per hour. Reserved Instances (and the more flexible Savings Plans) trade a 1- or 3-year commitment for a discount of up to about 72% compared with On-Demand. Spot Instances let you bid for spare capacity at discounts of up to 90%, but AWS can reclaim the capacity with a two-minute warning when it is needed elsewhere — so Spot is ideal for fault-tolerant, interruptible work like batch jobs, rendering, and big data processing, and unsuitable for anything that cannot be interrupted. Dedicated Hosts give you a physical server for compliance or licensing reasons, and Dedicated Instances run on hardware dedicated to your account without the host-level visibility.
The exam's decision rule is simple: steady, predictable, long-running workloads belong on Reserved Instances or Savings Plans; variable or short-lived workloads stay On-Demand; interruptible batch work goes on Spot. Many questions combine this with Auto Scaling: a fleet with a stable baseline plus variable peaks should use Reserved capacity for the baseline and On-Demand or Spot for the peaks.
Placement groups and high performance
A placement group controls how instances are physically placed relative to each other. A cluster placement group packs instances into a single Availability Zone, close together, for workloads that need low latency and high network throughput between nodes — high-performance computing and tightly coupled distributed systems. A spread placement group puts each instance on distinct underlying hardware, so a single hardware failure takes out at most one instance; it is limited to seven instances per AZ. A partition placement group divides instances into groups (partitions) on separate racks, so a rack failure affects only one partition — the right choice for large distributed systems like Hadoop or Cassandra clusters where you want isolation without the seven-instance limit. Cluster placement groups cannot span AZs, which is a trade-off: you gain network performance and lose AZ-level resilience.
Beyond EC2: the compute spectrum
The exam also tests when NOT to use EC2. AWS Lambda runs code without servers for short, event-driven tasks. Amazon ECS and Amazon EKS run containers — ECS with AWS's own orchestrator, EKS with Kubernetes — and both can run on EC2 or on AWS Fargate, which removes the servers entirely. AWS Elastic Beanstalk is a platform-as-a-service option that deploys your application code and manages the underlying EC2, load balancing, and scaling for you. The decision usually comes down to how much control you need versus how much undifferentiated work you want to hand to AWS: full control means EC2, containers mean ECS or EKS, and “just run my code” means Lambda or Beanstalk.
Networking, metadata, and instance features
Several EC2 features matter for performance and security. Enhanced networking uses the Elastic Network Adapter (ENA) to deliver higher bandwidth, higher packet rates, and lower latency than the older virtual network interface — it is enabled by default on current-generation instance types. For workloads that need the lowest possible node-to-node latency, such as tightly coupled HPC simulations, the Elastic Fabric Adapter (EFA) is a network device you can attach to supported instance types; it bypasses the operating system's network stack for direct communication between instances and is designed to be used with a cluster placement group. EBS-optimized instances provide dedicated bandwidth between the instance and its EBS volumes so storage traffic does not compete with network traffic.
Every EC2 instance can reach the instance metadata service at a special link-local address (169.254.169.254) to learn facts about itself: its instance ID, its Availability Zone, its IAM role credentials, and its user data. The current version, IMDSv2, requires a session token before metadata is returned, which protects against server-side request forgery attacks that could otherwise steal the instance's role credentials. AWS recommends enforcing IMDSv2, and the exam treats it as a best practice. Instance hibernation lets you pause an instance and resume it later with its RAM contents preserved on the EBS root volume — useful for long-running processes that you want to stop and restart without losing in-memory state. And EC2 Auto Recovery automatically recovers an instance when the underlying host fails, restarting it on healthy hardware with the same instance ID, private IP, and EBS volumes.
Exam traps to watch for
- Running sustained high-CPU workloads on burstable T instances: once CPU credits run out, performance is throttled to the baseline. Match the family to the workload pattern.
- Using Spot Instances for workloads that cannot tolerate interruption. Spot is for fault-tolerant batch work; a stateful production database on Spot is a design error.
- Forgetting that cluster placement groups live in a single Availability Zone — great for latency, bad for availability. Do not use them where AZ resilience is required.
- Paying On-Demand prices for a steady-state fleet. A predictable baseline should be covered by Reserved Instances or a Savings Plan.
Practice questions
Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.
Q1.A company runs a nightly batch job that processes log files. The job takes about 3 hours, can be interrupted and resumed without data loss, and the company wants to minimize compute cost. Which EC2 purchasing option is MOST cost-effective for this workload?
Explanation: Spot Instances offer spare capacity at discounts of up to 90%, and this workload is the textbook fit: it is short-lived, fault-tolerant, and can be interrupted and resumed. Option D costs far more per hour with no benefit for a batch job. Option A is the most expensive option and is meant for compliance or licensing needs, not batch cost savings. Option B locks in a 3-year commitment for a job that runs 3 hours a day, which wastes most of the reserved capacity.
Exam objective: SAA-C03 Task Statement 4.2: Design cost-optimized compute solutions
Q2.A web application runs on T3 instances. During a sustained traffic increase, response times degrade badly even though the instances have spare memory and network capacity. CloudWatch shows the CPU credit balance at zero. What is the BEST solution?
Explanation: T instances are burstable: they perform well in bursts but are throttled to a baseline once CPU credits run out, so they are the wrong family for sustained high CPU. Moving to general-purpose M instances sized for the real load fixes the root cause. Option A (unlimited mode) lets the instance burst beyond its credits for an extra charge, which papers over a workload that is simply not burstable and costs more than the right family. Option C adds more instances that will all run out of credits the same way. Option D is unrelated: the bottleneck is CPU, not storage.
Exam objective: SAA-C03 Task Statement 3.2: Design high-performing and elastic compute solutions
Q3.A research team runs a high-performance computing simulation on a cluster of EC2 instances. The instances exchange large amounts of data with each other and need the lowest possible network latency between nodes. Which placement group type should the solutions architect use?
Explanation: A cluster placement group packs instances close together in a single Availability Zone, giving low latency and high network throughput between nodes — exactly what a tightly coupled HPC simulation needs. Option D is designed for hardware-failure isolation (one instance per rack) and does not optimize for latency. Option C isolates groups of instances across racks, which is for large distributed systems that need partition-level fault isolation, not minimum latency. Option B leaves placement to chance, so instances may land far apart.
Exam objective: SAA-C03 Task Statement 3.2: Design high-performing and elastic compute solutions
Q4.A company runs a production web application 24 hours a day, 7 days a week, with a stable baseline of 20 instances and traffic peaks that need up to 10 more instances for a few hours each day. How should the company purchase this capacity to minimize cost while handling the peaks?
Explanation: The stable baseline is predictable, so committing to it with Reserved Instances or a Savings Plan earns the large discount; the variable peak capacity stays On-Demand because it is only needed a few hours a day. Option D pays the highest price for capacity that could have been discounted. Option C risks the production application being interrupted when Spot capacity is reclaimed. Option B pays for 10 reserved instances that sit idle most of the day.
Exam objective: SAA-C03 Task Statement 4.2: Design cost-optimized compute solutions
Q5.A solutions architect needs to deploy the same custom-configured application server image in two AWS Regions for disaster recovery. What is the correct approach?
Explanation: AMIs are Regional resources: an AMI created in one Region cannot be used to launch instances in another until it is copied. Copying the AMI to the second Region makes the identical image available there. Option C fails because the AMI does not exist in the second Region. Option A uses the wrong tool — DataSync moves file data, not machine images (VM Import/Export exists but is far more complex than an AMI copy for this purpose). Option D is factually wrong: AMI IDs are Region-specific.
Exam objective: SAA-C03 Task Statement 2.2: Design highly available and/or fault-tolerant architectures
Q6.A company runs an in-memory caching layer that needs instances with a very high ratio of memory to vCPU. Which EC2 instance family is the BEST fit?
Explanation: The R family is memory optimized: it provides a high ratio of RAM to vCPU, which is what an in-memory cache needs. Option C optimizes for CPU, the opposite of the requirement. Option B optimizes for fast local storage throughput, which a memory cache does not use. Option D offers burstable CPU for variable workloads, not large memory capacity.
Exam objective: SAA-C03 Task Statement 3.2: Design high-performing and elastic compute solutions
Q7.A company wants to run a containerized microservices application without managing any EC2 instances or container servers. Which combination of AWS services meets this requirement?
Explanation: ECS with Fargate runs containers serverlessly: you define the task and AWS provisions the compute, so there are no instances or nodes to manage. Option A requires managing EC2 instances, which the requirement rules out. Option D runs functions, not containers, and does not provide a container orchestration platform for microservices. Option C (self-managed node groups) explicitly requires managing the underlying EC2 nodes.
Exam objective: SAA-C03 Task Statement 3.2: Design high-performing and elastic compute solutions
Q8.A development team stops its EC2 test instances every evening and restarts them each morning to save cost. The instances use EBS-backed root volumes. What happens to the data on the root volumes while the instances are stopped?
Explanation: Stopping an EBS-backed instance preserves its EBS volumes, so all data on the root volume is still there when the instance restarts — this is exactly why stop/start is a valid cost-saving pattern. Option D describes what happens to instance store volumes (and to the root volume only on termination, if delete-on-termination is set). Option A invents an automatic S3 copy that does not exist. Option C has it backwards: instance store data is lost on stop, while EBS data persists.
Exam objective: SAA-C03 Task Statement 3.2: Design high-performing and elastic compute solutions