CLF-C02 Question 179
Single answerA company hosts their e-commerce application on Amazon EC2 instances. During sales events, the application experiences sudden spikes in traffic, which causes performance issues. How can the company address these spikes while minimizing costs and ensuring the application scales automatically?
- A
Manually launch additional EC2 instances during traffic spikes and terminate them afterward.
- B
Use Amazon EC2 Auto Scaling to automatically add or remove instances based on traffic demand.
- C
Upgrade all EC2 instances to larger instance types before sales events to handle increased traffic.
- D
Use AWS CloudFormation to deploy a fixed number of EC2 instances to handle peak traffic.
Show answer and explanation
Correct answer: B
Explanation
Amazon EC2 Auto Scaling allows the application to automatically scale the number of instances up or down based on traffic demand. This ensures cost-effectiveness by avoiding over-provisioning while maintaining performance during traffic spikes. It aligns with the principle of elasticity in cloud computing.
- A. Incorrect.
Manually launching and terminating instances can be error-prone, time-consuming, and does not provide true elasticity. This option does not leverage automation.
- B. Correct.
Amazon EC2 Auto Scaling enables the dynamic scaling of instances based on predefined conditions, providing elasticity to handle traffic spikes and minimizing costs during low usage periods.
- C. Incorrect.
Upgrading to larger instance types increases costs regardless of actual demand and does not dynamically adjust to traffic changes, making it an inefficient solution.
- D. Incorrect.
Using AWS CloudFormation to deploy a fixed number of instances does not provide elasticity since the number of instances remains static, regardless of fluctuating traffic.