Question #1054
A company is hosting a web application on AWS using 20 Amazon EC2 On-Demand Instances distributed across two Availability Zones behind a Network Load Balancer (NLB). The application is stateless and operates continuously. Users report performance degradation during traffic spikes, where CPU utilization reaches 100%, though it remains at 10% during normal operation. The company seeks a cost-effective architectural solution to address the slowdowns.
Which option MOST cost-effectively resolves the performance issue?
Configure an Auto Scaling group attached to the NLB's target group. Set the minimum capacity to 20 and desired capacity to 35. Purchase Reserved Instances for 20 instances and use On-Demand for scaling.
Deploy a Spot Fleet with a request type of 'capacity-optimized.' Set TotalTargetCapacity to 20 and DefaultTargetCapacityType to On-Demand. Attach the fleet to the existing NLB.
Replace the NLB with an Application Load Balancer (ALB). Use a Spot Fleet with 'maintain' request type, TotalTargetCapacity of 20, and DefaultTargetCapacityType as Spot. Purchase Reserved Instances for 10 instances.
Implement an Auto Scaling group linked to the NLB's target group. Set minimum capacity to 4 and maximum to 35. Purchase Reserved Instances for 4 instances, scaling with On-Demand during peaks.
Explanation
The correct answer is D because it leverages Auto Scaling to dynamically adjust the number of EC2 instances based on traffic demands. By setting the minimum capacity to 4 (using Reserved Instances for cost savings) and allowing scaling up to 35 (using On-Demand Instances during spikes), the solution optimizes costs while addressing performance degradation. During normal operation (10% CPU), fewer instances reduce costs, and scaling ensures sufficient capacity during peaks. Other options are less optimal:
- A: Maintaining 20 Reserved Instances unnecessarily increases costs during low traffic.
- B: A fixed Spot Fleet of 20 instances cannot scale to handle traffic spikes.
- C: Replacing NLB with ALB is unnecessary, and relying on Spot Instances risks interruptions during spikes.
Key takeaways: Use Auto Scaling with Reserved Instances for baseline capacity and On-Demand for scaling. Stateless applications benefit from dynamic scaling to handle variable loads cost-effectively.
Answer
The correct answer is: D