A cloud engineering team operates a Managed Instance Group (MIG) that processes asynchronous background tasks from a Cloud Pub/Sub subscription. During high-traffic events, CPU utilization across the VM instances remains below 25%, but the message backlog grows significantly, resulting in SLA violations. The team needs to reconfigure the MIG autoscaling strategy to scale based on the number of unacknowledged messages in the subscription and ensure newly launched instances complete their startup scripts before the autoscaler evaluates performance metrics. Which configuration approach should the engineer implement?
- Configure the autoscaling policy to use a Cloud Monitoring metric tracking Pub/Sub unacknowledged messages, and set an appropriate cool-down period on the autoscaler.Cevap
- BLower the autoscaling policy target CPU utilization threshold from 80% to 15% and configure a health check delay interval.
- CAssign the Project Owner primitive role to the Compute Engine default service account and configure instance uptime as the scaling metric.
- DSubmit an automated GCP Quota Increase request for Compute Engine API requests to accelerate metric sampling rates during queue spikes.
Cevap
Configure the autoscaling policy to use a Cloud Monitoring metric tracking Pub/Sub unacknowledged messages, and set an appropriate cool-down period on the autoscaler.
To auto-scale a Managed Instance Group based on Pub/Sub workload requirements, Google Cloud best practice dictates using a Cloud Monitoring metric (such as unacknowledged message count). Configuring a cool-down period ensures the autoscaler ignores metric anomalies during VM startup and initialization.
Adım Adım Çözüm
Anahtar Kavram
Compute Engine MIG Custom Metric Autoscaling and Cool-down Periods