Google Professional Cloud DevOps Engineer Question 107
Select 3Google Cloud PlatformYour team manages a web application hosted on Google Cloud using a managed instance group (MIG). The application experiences periodic traffic spikes during certain hours of the day. To optimize costs while maintaining availability during peak hours, you decide to implement autoscaling. Which of the following configurations would ensure that the application scales appropriately to handle traffic spikes and scales down during low traffic periods?
- A
Set up an autoscaling policy based on CPU utilization, with a target CPU utilization threshold of 70%.
- B
Configure a minimum number of instances in the managed instance group to handle baseline traffic during off-peak hours.
- C
Set up a schedule-based autoscaling policy to add instances during peak hours and remove them during off-peak hours.
- D
Use a static number of instances in the managed instance group to simplify operational complexity.
- E
Enable autoscaling based on custom metrics from Cloud Monitoring to respond to specific business logic.
Show answer and explanation
Correct answers: A, B, E
Explanation
To handle periodic traffic spikes effectively while optimizing costs, combining autoscaling policies based on CPU utilization, baseline instance configuration, and custom metrics ensures both flexibility and responsiveness. These configurations allow the managed instance group to adapt to real-time traffic patterns and business-specific needs, reducing the risk of downtime or unnecessary costs.
- A. Correct.
This is correct because setting a target CPU utilization for autoscaling ensures that the application can dynamically scale up or down based on actual load, making it cost-effective and responsive to traffic spikes.
- B. Correct.
This is correct because configuring a minimum number of instances ensures that the application can handle baseline traffic during off-peak hours, preventing downtime or slow performance.
- C. Incorrect.
This is incorrect because schedule-based autoscaling is less flexible and may not respond effectively to unexpected traffic patterns outside the defined schedule.
- D. Incorrect.
This is incorrect because using a static number of instances does not provide the flexibility needed to handle dynamic traffic patterns, leading to potential over-provisioning or under-provisioning.
- E. Correct.
This is correct because autoscaling based on custom metrics allows for more granular and business-specific scaling decisions, which can be critical for certain workloads.