Elastic Compute: Auto Scaling Policies, Lambda Tuning, and Compute Selection
Task 3.2 covers designing compute that performs under load and scales elastically: mapping each workload to the right service — EC2, Lambda, Fargate, AWS Batch, or EMR; choosing EC2 instance families by the resource that actually bottlenecks; tuning Lambda with its single memory dial under the 15-minute cap; picking a container orchestrator (ECS or EKS) and the capacity it runs on (Fargate, ECS Managed Instances, or your own EC2 instances); and, above all, selecting the right Auto Scaling policy — target tracking, step, scheduled, or predictive — including scaling on custom metrics like SQS queue backlog, and keeping new instances from distorting the metrics while they boot. It sits in Design High-Performing Architectures, and scaling-policy selection is one of the most repeatable question patterns on the whole exam. The scenarios hand you a traffic shape and a constraint qualifier — MOST performant, LEAST operational overhead, MOST cost-effective — and every option computes; only one fits. By the end of this lesson you will read the traffic pattern out of a scenario and name the compute service, instance family, and scaling policy it demands, with the eliminations to defend the choice.
What you’ll learn
- Map any workload to the right compute service — EC2, Lambda, Fargate, AWS Batch, EMR, or EMR Serverless — from its duration, trigger, framework, and management constraints
- Select an EC2 instance family by identifying the bottleneck resource, and right-size it with AWS Compute Optimizer rather than an idle-instance check
- Size Lambda memory knowing where extra CPU stops helping, and choose between provisioned concurrency, SnapStart, and reserved concurrency
- Choose the right Auto Scaling policy — target tracking, step, simple, scheduled, or predictive — for a given traffic pattern, including one-off events
- Use default instance warmup, the health check grace period, and warm pools correctly when instances are slow to become ready
- Design queue-based scaling with a backlog-per-instance metric, and fan events out with SNS so decoupled consumers scale independently
- Decide between ECS and EKS, and between Fargate, ECS Managed Instances, and Auto Scaling group capacity, from stated requirements
The 10 parts · about 22 min of reading
- Map the workload to the compute service before tuning anythingStart hereRead run time, trigger and how much infrastructure you will manage from the scenario, and the compute service names itself.1 min
- AWS Batch vs Lambda vs EMRAsk whether each unit of work fits in 15 minutes, then whether a named big-data framework is involved: no means AWS Batch, yes means EMR.2 min
- EC2 instance familiesIdentify the resource the workload exhausts first and buy the family built around it, then right-size with AWS Compute Optimizer.2 min
- Lambda performanceMemory is the only performance dial and CPU scales with it; cold starts need provisioned concurrency or SnapStart, and 15 minutes is final.3 min
- Containers: ECS vs EKS, and the Fargate launch decisionPick ECS unless Kubernetes is named, then choose capacity: Fargate for least overhead, EC2-backed options for GPUs or a custom AMI.2 min
- Auto Scaling policiesTarget tracking holds a steady target, step scales by breach size, scheduled follows the calendar and predictive forecasts recurring cycles.3 min
- Warmup, cooldown, grace period, and warm poolsDefault instance warmup stops overshoot by fixing the measurement, while a warm pool keeps pre-initialized instances ready to serve.2 min
- Scaling on the right signalScale queue workers on backlog per instance rather than CPU, and decouple tiers with SQS so each scales on its own signal.3 min
- Levers outside the fleetCloudFront caching removes load from the origin, Global Accelerator caches nothing, and hibernated warm pools resume with memory intact.2 min
- Worked scenariosA recurring ramp of varying height with slow-starting instances means predictive scaling; hours-long container jobs mean AWS Batch on Spot.2 min
Mind map
How the exam tests this
SAA-C03 tests Task 3.2 with traffic-shaped scenarios: a workload description, a pain point (lag during ramps, lost requests in bursts, slow functions, over-scaling while instances boot, budget pressure), and a qualifier like LEAST operational overhead or MOST cost-effective. The most repeatable shapes are the scaling-policy match — recurring-but-variable patterns to predictive (forecast and scale), fixed clocks and one-off events to scheduled actions on minimum and desired capacity, steady utilization goals to target tracking, graduated responses to step scaling, queue depth to a backlog-per-instance metric — and the compute-selection two-step, where a job's duration eliminates Lambda at 15 minutes and a named big-data framework splits EMR (or EMR Serverless) from AWS Batch. Expect near-twins that sound alike but do different jobs: default instance warmup vs health check grace period vs cooldown; provisioned concurrency vs SnapStart vs more memory; Fargate vs ECS Managed Instances vs an Auto Scaling group capacity provider; Compute Optimizer vs Trusted Advisor; SNS fan-out vs one shared queue; CloudFront vs Global Accelerator. Distractors scale on CPU when the real signal is a queue, hand-build what Batch or Fargate provides managed, pick EKS with no Kubernetes requirement, or raise Lambda memory past the point where single-threaded code can use it.
Key takeaways
- Pick the compute service by duration, trigger, and management appetite: event-driven and under 15 minutes = Lambda; containers with least overhead = Fargate; hardware control = EC2; queued heavy jobs = AWS Batch; named big-data frameworks = EMR, or EMR Serverless when no cluster should be chosen or kept running.
- Over 15 minutes rules out Lambda — container-image functions included; a named framework (Spark/Hadoop/Hive) means EMR; otherwise batch jobs mean AWS Batch (Spot for retryable work), and a scheduled container job is an ECS task on Fargate started by EventBridge Scheduler.
- Choose EC2 families by the bottleneck resource — C for CPU, R/X for memory, I/D for local storage I/O, P/G for accelerators, M as the balanced default; right-size with Compute Optimizer, which recommends types in both directions, unlike Trusted Advisor's idle-instance check.
- Lambda memory sets CPU: more memory can make a function faster and cheaper, but single-threaded code stops speeding up near 1,769 MB (one vCPU). Cold starts are fixed by provisioned concurrency (paid, always warm) or SnapStart (snapshot restore), never by memory.
- Target tracking is the default; step scaling = one alarm with step adjustments per breach range; simple scaling = one adjustment plus a cooldown; scheduled = known times (raise min/desired, not just max); predictive = recurring patterns, in forecast-and-scale mode.
- Default instance warmup keeps booting instances out of the metrics while counting their capacity; the health check grace period only delays health checks; warm pools (Stopped, Running, Hibernated) pre-initialize slow instances.
- Scale worker fleets on backlog per instance with a target of acceptable latency ÷ per-message processing time — raw queue length is not proportional to fleet size.
- Consumers on one SQS queue compete for messages; when every service must see every event, fan out through SNS to one queue per consumer. ECS vs EKS turns on a Kubernetes requirement; GPUs rule out Fargate, and a custom AMI rules out ECS Managed Instances.
Part 1: Map the workload to the compute service before tuning anything
Read run time, trigger and how much infrastructure you will manage from the scenario, and the compute service names itself.
Frequently asked questions
What is the difference between target tracking and step scaling?
Target tracking works like a thermostat: you choose a metric and a target value — keep average CPU at 50%, keep requests per target at a set level — and the Auto Scaling group creates its own alarms and adds or removes instances to hold it. Step scaling makes you define the response yourself: a step scaling policy is attached to one CloudWatch alarm, and its step adjustments set different capacity changes for different ranges of breach above that alarm's threshold, so a small breach adds a little capacity and a large one adds a lot. Simple scaling, the older form, makes one fixed adjustment per alarm and then waits out a cooldown. Use target tracking by default, and step scaling when graduated responses to known load levels are required.
When should I use predictive scaling vs scheduled scaling?
Both act before demand arrives; they differ in who decides the timing and size. Scheduled scaling follows actions you write: at a set date and time it changes the group's minimum, maximum, or desired capacity — right when timing and amount are known, including a one-off event such as a product launch or a filing deadline (raise minimum and desired capacity; raising only the maximum launches nothing). Predictive scaling forecasts from recurring daily and weekly patterns in recent history and provisions ahead of the predicted ramp — right when the pattern repeats but its size varies, especially when instances are slow to initialize. It cannot predict a one-off event, and it only changes capacity in forecast-and-scale mode (forecast-only, the default, just reports). Pair either with target tracking.
How does Lambda memory affect CPU and performance?
Memory is Lambda's only performance dial: CPU and network throughput scale with the memory you allocate, so raising memory is how you give a function more compute even if it never uses the extra RAM. At 1,769 MB a function gets the equivalent of one vCPU; higher settings add vCPUs (up to six at 10,240 MB), which only help code that runs in parallel — single-threaded CPU-bound code stops getting faster around 1,769 MB, so going higher just costs more. Because Lambda bills memory multiplied by duration, more memory can shorten a run enough that cost stays flat or drops. Memory does not fix cold starts; provisioned concurrency or SnapStart does.
Sign up free to mark lessons complete, bookmark topics and track your exam readiness.