SOA-C02 Question 290
Select 3Your company runs a web application that experiences unpredictable traffic spikes. The application is currently hosted on EC2 instances behind an Application Load Balancer (ALB). You notice that during these spikes, the application incurs high costs due to over-provisioned EC2 instances in an Auto Scaling group to handle peak loads. Which of the following actions can you take to optimize both cost and performance for this workload?
- A
Implement AWS Auto Scaling with a dynamic scaling policy based on CPU utilization.
- B
Enable Elastic Load Balancing (ELB) access logs to monitor traffic patterns.
- C
Replace the EC2 instances with AWS Lambda functions for handling traffic spikes.
- D
Use Spot Instances for the Auto Scaling group to reduce instance costs.
- E
Configure an Amazon CloudFront distribution in front of the ALB to cache static content.
Show answer and explanation
Correct answers: A, D, E
Explanation
To optimize cost and performance for an application with unpredictable traffic, you can leverage dynamic scaling to match EC2 capacity to actual demand, use Spot Instances to reduce costs for non-critical workloads, and implement caching with CloudFront to reduce backend load. These measures collectively help balance performance and cost efficiency.
- A. Correct.
This is correct. Using dynamic scaling policies based on metrics like CPU utilization ensures that your Auto Scaling group adjusts the number of instances in response to real-time demand, preventing over-provisioning and reducing costs during low-traffic periods.
- B. Incorrect.
This is incorrect. While enabling ELB access logs can provide valuable insights into traffic patterns, it does not directly optimize cost or performance.
- C. Incorrect.
This is incorrect. While AWS Lambda is cost-effective for certain workloads, it may not be suitable for this scenario if the application has long-running processes or requires stateful operations.
- D. Correct.
This is correct. Spot Instances can significantly reduce EC2 instance costs, especially for workloads that can tolerate interruptions.
- E. Correct.
This is correct. Configuring CloudFront in front of the ALB can cache static content, reducing the load on backend EC2 instances and improving performance for end users.