Q54 — AWS SAA-C03 Ch.14
Question 54 of 100 | ← Chapter 14
Q1054. A company hosts a website analytics application on a single Amazon EC2 On-Demand Instance. The analytics application is highly resilient and is designed to run in stateless mode.The company notices that the application is showing signs of performance degradation during busy times and is presenting 5xx errors. The company needs to make the application scale seamlessly.Which solution will meet these requirements MOST cost-effectively?
- A. Create an Amazon Machine Image (AMI) of the web application. Use the AMI to launch a second EC2 On-Demand Instance. Use an Application Load Balancer to distribute the load across the two EC2 instances.
- B. Create an Amazon Machine Image (AMI) of the web application. Use the AMI to launch a second EC2 On-Demand Instance. Use Amazon Route 53 weighted routing to distribute the load across the two EC2 instances.
- C. Create an AWS Lambda function to stop the EC2 instance and change the instance type. Create an Amazon CloudWatch alarm to invoke the Lambda function when CPU utilization is more than 75%.
- D. Create an Amazon Machine Image (AMI) of the web application. Apply the AMI to a launch template.Create an Auto Scaling group that includes the launch template. Configure the launch template to use a Spot Fleet. Attach an Application Load Balancer to the Auto Scaling group. ✓
Correct Answer: D. Create an Amazon Machine Image (AMI) of the web application. Apply the AMI to a launch template.Create an Auto Scaling group that includes the launch template. Configure the launch template to use a Spot Fleet. Attach an Application Load Balancer to the Auto Scaling group.
Explanation
To ensure that the website analytics application can scale seamlessly during busy times while remaining cost-effective, the best solution is:D. Create an Amazon Machine Image (AMI) of the web application. Apply the AMI to a launch template. Create an Auto Scaling group that includes the launch template. Configure the launch template to use a Spot Fleet. Attach an Application Load Balancer to the Auto Scaling group.Explanation:\1. Auto Scaling Group: - An Auto Scaling group allows the application to automatically adjust the number of EC2 instances in response to changes in demand. This means that during busy times, more instances will be launched to handle increased traffic, preventing performance degradation and 5xx errors.\2. Launch Template and AMI: - Using a launch template with an AMI simplifies the process of launching new instances with the required configuration. This ensures that all instances are consistent and can be quickly spun up when needed.\3. Spot Fleet: - Configuring the launch template to use a Spot Fleet can significantly reduce costs compared to using On-Demand instances while still providing the flexibility to scale. Spot Instances can be used for applications that can tolerate interruptions, making it a cost-effective solution.\4. Application Load Balancer: - Attaching an Application Load Balancer to the Auto Scaling group ensures that incoming traffic is distributed evenly across the running instances, improving performance and reliability.Evaluation of Other Options:A. Create an AMI and launch a second EC2 On-Demand Instance with an Application Load Balancer: - While this option adds redundancy, it does not solve the issue of scaling automatically based on demand, which is essential for handling traffic spikes effectively.B. Create an AMI and launch a second EC2 On-Demand Instance with Route 53 weighted routing: - Similar to option A, this does not provide automatic scaling. Route 53 weighted routing is not optimal for load balancing EC2 instances compared to an Application Load Balancer.C. Create an AWS Lambda function to stop the EC2 instance and change the instance type: - This approach is inefficient for scaling. It introduces unnecessary complexity and does not allow for seamless scaling during traffic spikes. Additionally, stopping instances can lead to downtime, which is not acceptable for a production application.Conclusion:Option D provides a comprehensive and efficient solution for seamless scaling of the website analytics application while optimizing costs through the use of Spot Instances and an Auto Scaling group.