A meal-kit company runs order APIs on EC2 Auto Scaling and Fargate services with sharp lunch peaks and idle nights. Finance demands lower cost without breaching p95 latency during surges. Which rightsizing and scaling mix is most effective?
Select an answer to reveal the explanation.
Short Explanation
Lunch rush then crickets? You're matching capacity to appetite with target tracking backed by rightsizing and Spot savings for idle-friendly work.
Full Explanation
The correct mix succeeds because it addresses both cost dimensions together: Compute Optimizer provides data-driven rightsizing to remove overprovisioned EC2 capacity, target tracking on metrics like CPU or request count per target dynamically maintains p95 latency during sharp unpredictable lunch surges, scheduled scaling proactively scales down for idle nights and pre-warms for known peaks, and Fargate Spot absorbs fault-tolerant container capacity at deep discount without sacrificing availability when combined with On-Demand base capacity. The On-Demand-only variant with rightsizing and both scaling policies preserves performance and handles day-night patterns well but forfeits the significant container savings required by the finance mandate, since suitable Fargate workloads can run on Spot with automatic fallback. The retain-current-types variant improves elasticity and cost through dynamic scaling and Spot but leaves the underlying rightsizing waste untouched, so oversized instances continue to inflate the hourly baseline despite better utilization curves. The scheduled-only variant with rightsizing and Spot lowers baseline and nighttime spend for predictable periods but cannot react to surge intensity or timing variance, so unexpected lunch traffic breaches p95 until the next schedule boundary because no utilization-driven policy adds capacity. As an exam caveat, distinguish predictable time-based patterns that favor scheduled scaling from dynamic load-driven spikes that require target tracking or step scaling, as questions deliberately test combining them. As a practical check, validate Compute Optimizer recommendations for two weeks, load-test target tracking thresholds for p95, and confirm Fargate Spot interruption handling with retries and diversified capacity before production rollout.