A company runs a stateless web application on EC2 instances behind an Application Load Balancer. The traffic is highly predictable, peaking during business hours and dropping significantly at night. Which strategy offers the most cost-effective solution for this workload?
Trap 1: Provision On-Demand instances sized for peak capacity 24/7.
Provisioning for peak capacity at all times results in significant over-provisioning during off-peak hours. You would pay for compute cycles that remain idle during the night, leading to unnecessary expenses. This is the least cost-effective strategy for workloads with predictable, fluctuating traffic patterns.
Trap 2: Migrate the entire application to AWS Lambda functions.
While serverless can be cost-effective, migrating a stateless application to Lambda may involve significant refactoring costs and potential latency issues if the application is not designed for event-driven execution. It is not inherently cheaper than EC2 for high-volume, steady-state traffic workloads compared to optimized RI usage.
Trap 3: Use Spot Instances for the entire fleet to maximize savings.
Spot instances can be interrupted with only a two-minute warning, making them unsuitable for core web application tiers that require high availability. Relying on Spot for the entire fleet risks application downtime during price spikes or capacity reclamation, failing to meet production stability requirements for user-facing services.
- A
Provision On-Demand instances sized for peak capacity 24/7.
Why it fails: Provisioning for peak capacity at all times results in significant over-provisioning during off-peak hours. You would pay for compute cycles that remain idle during the night, leading to unnecessary expenses. This is the least cost-effective strategy for workloads with predictable, fluctuating traffic patterns.
- B
Migrate the entire application to AWS Lambda functions.
Why it fails: While serverless can be cost-effective, migrating a stateless application to Lambda may involve significant refactoring costs and potential latency issues if the application is not designed for event-driven execution. It is not inherently cheaper than EC2 for high-volume, steady-state traffic workloads compared to optimized RI usage.
- C
Use Reserved Instances for base capacity and Auto Scaling with On-Demand instances for peaks.
Reserved Instances provide substantial discounts for steady-state workloads. By covering the predictable base load with RIs and using Auto Scaling to handle demand spikes with On-Demand instances, you balance cost savings with application availability, effectively minimizing the total cost of ownership for a predictable, fluctuating workload.
- D
Use Spot Instances for the entire fleet to maximize savings.
Why it fails: Spot instances can be interrupted with only a two-minute warning, making them unsuitable for core web application tiers that require high availability. Relying on Spot for the entire fleet risks application downtime during price spikes or capacity reclamation, failing to meet production stability requirements for user-facing services.