An enterprise retail platform is preparing for an annual flash sale expected to increase incoming order traffic by 500% within minutes. The order processing service runs on a Compute Engine Managed Instance Group (MIG) that consumes messages from a Cloud Pub/Sub topic. Stress testing reveals that scaling the MIG based on CPU utilization is ineffective because workers spend significant time waiting on external database I/O, leading to delayed scale-out and queue backlog buildup. Additionally, the required peak capacity for the event exceeds the project's current regional N2 CPU limits. Which TWO actions should the Cloud Architect take to ensure operational reliability and seamless capacity scaling during the flash sale?
- Configure the MIG autoscaler to scale based on a custom Cloud Monitoring metric tracking Cloud Pub/Sub unacknowledged message queue depth per instance.Answer
- BLower the target CPU utilization threshold on the MIG autoscaler to 20% to force earlier instance creation during I/O wait states.
- Submit a regional quota increase request for Compute Engine N2 CPUs in the target region well in advance of the sale event.Answer
- DRely on Compute Engine dynamic quota expansion to automatically raise the project regional CPU limits when autoscaling demand spikes.
- EMigrate the processing workload to a Google Kubernetes Engine (GKE) Autopilot cluster to bypass regional Compute Engine CPU quota constraints.
Answer
The Cloud Architect should configure the MIG autoscaler using a custom Cloud Monitoring metric for Cloud Pub/Sub unacknowledged message queue depth and submit a regional Compute Engine N2 CPU quota increase request in advance.
For I/O-bound background worker services consuming from message queues, CPU utilization is an unreliable metric because worker threads spend time blocked on external database operations while keeping CPU usage low. Configuring the Managed Instance Group to scale based on a custom Cloud Monitoring metric tracking Cloud Pub/Sub unacknowledged message count ensures scaling responds immediately to queue backlog. Furthermore, GCP resource quotas represent administrative limits that do not expand automatically; submitting a regional N2 CPU quota request prior to the high-traffic event guarantees that Compute Engine can provision the required VM instances during scale-out.
Step-by-Step Solution
Key Concept
Custom Metric Autoscaling and Proactive Capacity Quota Planning