Compute rightsizing, scaling, availability, and load-balancer economics
Explain and apply how to rightsize, schedule, scale, preserve availability, and price load balancing. Compare average/percentile, horizontal/vertical, and production/nonproduction under explicit security, resilience, performance, operations, and cost constraints.
LESSON GOALS
By the end, you can
- Explain and apply how to rightsize, schedule, scale, preserve availability, and price load balancing.
- Compare average/percentile, horizontal/vertical, and production/nonproduction under explicit security, resilience, performance, operations, and cost constraints.
01
Diagnose Before Scaling
Rightsizing starts with the resource that limits completed work. Inspect CPU percentiles, memory pressure, network packets and bytes, EBS throughput and IOPS, accelerator use, request rate, latency, and queueing over representative peaks. Average CPU cannot clear a memory-bound service. Vertical scaling changes the capacity of one instance and may require stop, restart, or replacement; it is useful for a stateful or single-thread-constrained component but retains a finite ceiling and can enlarge a failure unit. Horizontal scaling adds replaceable instances and is favored for stateless tiers that can distribute traffic and externalize session state. It improves aggregate capacity and failure replacement but adds coordination, load balancing, warm-up, and downstream connection pressure. Compare both against the bottleneck and deployment model. Preserve enough healthy capacity to meet demand after the declared instance or AZ failure. A smaller fleet that passes normal load but collapses when one AZ is unavailable is not rightsized. Select a proportional scaling signal such as requests per target when it tracks load better than host CPU.
02
Schedule Stop Or Hibernate
Nonproduction demand should be treated as a schedule rather than a discounted always-on baseline. Stopping an EC2 instance removes compute charges but leaves attached EBS and other resources billable; starting requires applications to rebuild memory state. Hibernation preserves RAM contents to the encrypted root EBS volume and can shorten resume for eligible workloads, but it must be enabled and satisfy current AMI, instance-family, RAM, root-volume, and other prerequisites documented by AWS. It is a launch-time architecture choice, not an emergency toggle for every running host. Use it when expensive in-memory tool state has measurable reload value that exceeds additional storage and operational constraints. Ordinary stop/start wins when boot and warm-up are cheap. Termination or ephemeral recreation wins when no local state is needed. Always-on capacity wins only when availability or unpredictable access makes scheduling invalid. Recheck eligibility and maximum hibernation behavior because these details evolve. A schedule should include holidays, time zones, patch windows, and an exception process so savings automation does not interrupt active work.
03
Place Load Balancer And Price Headroom
Choose load-balancer function before comparing bills. ALB provides HTTP and HTTPS Layer 7 routing such as host or path decisions. NLB serves Layer 4 transport needs including TCP or UDP and supports static-address-oriented designs. GWLB inserts and scales compatible virtual appliance fleets rather than routing application URLs. Each service carries load-balancer time and a capacity-unit dimension under current ELB pricing, so traffic characteristics—not just bytes—affect cost. Include target fleet hours, cross-zone or transfer paths where applicable, logging, and spare capacity for a failed AZ. Health checks decide target eligibility, but a passing listener path does not prove the application fulfills its transaction SLO; inspect target response and dependency health. Horizontal scaling behind the correct load balancer can reduce idle peak capacity, provided warm-up and downstream limits are modeled. Vertical scaling may remain the better short-term repair for a memory-bound monolith that cannot safely duplicate state. Document the condition that would reverse the choice, then verify the selected architecture with a peak test and an AZ-capacity-loss test.
DECISION TABLE
Compare the architecture constraints
| requirement | choose | because | reject |
|---|---|---|---|
| HTTP host/path | ALB | L7 routing | NLB |
| TCP/UDP/static IP | NLB | L4 boundary | ALB |
| appliance insertion | GWLB | fleet service | app ingress |
| memory saturation | memory family | measured bottleneck | CPU family |
| memory-bound API plus nightly stoppable hosts | vertical memory rightsize, horizontal ASG, stop/start | shape, fleet count, and state preservation are separate | CPU-only scaling or unsupported hibernation |
GUIDED WORKED SCENARIO
Reason from the stated constraints
This is a guided example, not a question to memorise. The knowledge check uses new situations to test the same reasoning.
A two-AZ API has 40% average CPU but p95 memory 92%; it needs host/path routing and must survive one AZ while nonproduction can stop nights.
Requirements
- Production survives AZ loss
- p95 latency under 250 ms
- HTTP host/path routing
- Nonproduction schedule allowed
- Choose vertical versus horizontal scaling from the measured bottleneck, and choose stop/start versus hibernation from the need to preserve RAM state.
Reasoning path
- For Compute rightsizing, scaling, availability, and load-balancer economics, eliminate any candidate that violates the explicit security or failure/performance dimension.
- Quantify the scale, operating burden, and complete cost horizon specific to Compute rightsizing, scaling, availability, and load-balancer economics before ranking valid choices.
- Select the lowest-total-cost valid design for Compute rightsizing, scaling, availability, and load-balancer economics, then change one decisive constraint and re-evaluate the loser.
- Vertically fix the memory shape, horizontally scale the stateless fleet, and use stop/start because no overnight RAM preservation is required.
Why it wins
- Matches measured memory bottleneck
- ALB directly satisfies L7 behavior
- Scaling/availability capacity is explicit
- It separates a per-instance memory correction from fleet elasticity and avoids hibernation when ordinary stop/start meets the state requirement.
Why the alternatives lose
No HTTP host/path rules
Becomes correct when: Raw transport/static addresses requiredIt serves appliance insertion, not app routing
Becomes correct when: Firewall appliance fleet is requiredCPU is not correlated to memory pressure
Becomes correct when: CPU is measured bottleneckRAM preservation is not required and hibernation prerequisites were not established
Becomes correct when: In-memory state must survive and launch-time enablement plus platform prerequisites are verifiedARCHITECTURE VISUAL · TEXT MODE
Inspect the model
For Compute rightsizing, scaling, availability, and load-balancer economics, read a keyboard-ordered table of requirements, quantities, candidate path or service, first failed constraint, repair, winner, and changed-constraint result; animation and color are unnecessary.
saa-viz-scaling-failure-domain-lab · saa-viz-cost-transfer-labKNOWLEDGE CHECK
Answer one question at a time
Pass every question to complete this lesson. Each answer includes reasoning before you continue.
One development tool must resume its in-memory workspace and was launched with valid hibernation support. Which shutdown mode now wins?
Reveal reasoning
Hibernation replaces ordinary stop/start for that development host because preserving RAM state is now required and supported.
The API’s average CPU is 40%, so an engineer calls the fleet oversized despite 92% p95 memory. Which metric should drive the first correction?
Reveal reasoning
Use the memory percentile and related latency or pressure evidence to select a memory-optimized size; average CPU does not clear a different resource bottleneck.
Before reveal in the scaling lab, predict the outcome after one AZ fails if the normal fleet has no spare instance capacity.
Reveal reasoning
The failure-headroom gate fails: remaining instances cannot carry the load even if target tracking later reacts; maintain one-AZ capacity margin.
PRIMARY SOURCES
Verify the claims
- primaryAmazon EC2 instance typesaws-ec2-instance-types · retrieved 2026-07-30
- primaryWhat is Amazon EC2 Auto Scaling?aws-compute-asg · retrieved 2026-07-29
- primaryTarget tracking scaling policies for Amazon EC2 Auto Scalingaws-asg-target-tracking · retrieved 2026-07-30
- primaryWhat is AWS Compute Optimizer?aws-compute-optimizer-overview · retrieved 2026-07-30
- primaryWhat is an Application Load Balancer?aws-elb-application-load-balancer · retrieved 2026-07-30
- primaryWhat is a Network Load Balancer?aws-elb-network-load-balancer · retrieved 2026-07-30
- primaryWhat is a Gateway Load Balancer?aws-elb-gateway-load-balancer · retrieved 2026-07-30
- primaryPrerequisites for EC2 instance hibernationaws-ec2-hibernation-prerequisites · retrieved 2026-07-30
- primaryElb Pricingaws-elb-pricing · retrieved 2026-07-30
- primaryAlb Health Checksaws-alb-health-checks · retrieved 2026-07-30
- primaryNlb Health Checksaws-nlb-health-checks · retrieved 2026-07-30