Cost and Performance Optimization
What you must know
Pricing models (On-Demand, Reserved, Savings Plans, Spot); right-sizing and Compute Optimizer; S3 storage classes and lifecycle policies; EBS volume types (gp3, io2, st1, sc1); Auto Scaling policies (target tracking, step, scheduled, predictive); ElastiCache and DAX; RDS performance insights; Cost Explorer, Budgets, and Cost Anomaly Detection; tagging and cost allocation; Graviton instances.
Traps that show up in questions
- Spot instances can be interrupted with a two-minute warning. They suit stateless, fault-tolerant, checkpointed workloads - not databases. A question about a workload that must not be interrupted wants Reserved/Savings Plans.
- Savings Plans vs Reserved: Compute Savings Plans apply across EC2, Fargate, and Lambda and are more flexible; EC2 Instance Savings Plans are tied to a family/Region. Reserved Instances can be regional or zonal.
- gp3 vs gp2: gp3 lets you provision IOPS and throughput independently of size and is generally cheaper; gp2 scales IOPS with volume size.
- S3 Intelligent-Tiering is for unknown/changing access patterns; lifecycle transitions are for predictable patterns. Glacier Deep Archive has hours-long retrieval - wrong for frequently accessed data.
- Target tracking is the default recommendation for scaling; step scaling for fine-grained thresholds; scheduled for known traffic events.
- Cost allocation tags must be activated in the Billing console before they appear in cost reports.
Worked rule of thumb
When a question asks to reduce cost for a steady-state, predictable workload, recommend Savings Plans or Reserved capacity; for interruptible batch, recommend Spot; for spiky/unpredictable, keep On-Demand with target-tracking scaling. Combine with right-sizing via Compute Optimizer and Graviton where compatible. Always check whether the constraint is cost or performance before choosing.