Question

Difficulty: MediumAuto-scaling and Capacity Planning

A logistics enterprise processes real-time delivery routing updates ingested from thousands of vehicle tracking devices into a Cloud Pub/Sub topic. A Compute Engine Managed Instance Group (MIG) running worker services pulls messages from the subscription. During morning dispatch hours, the message queue depth spikes rapidly, but CPU utilization across worker instances remains under 20% because workers spend most of their time waiting on network calls to external mapping APIs. The operations team needs to ensure timely processing during peak hours while avoiding unexpected infrastructure provisioning failures. Which autoscaling and capacity planning strategy should you recommend?

  1. Configure the MIG autoscaler based on a custom Cloud Monitoring metric tracking the ratio of unacknowledged Pub/Sub messages per instance, and request regional Compute Engine resource quota increases prior to peak events.Answer
  2. B
    Configure the MIG autoscaler to target an average CPU utilization of 80% so that the instance group expands automatically when message queue depth increases.
  3. C
    Migrate the application from Compute Engine MIGs to a multi-zonal Google Kubernetes Engine (GKE) cluster managed by Horizontal Pod Autoscaler targeting CPU usage.
  4. D
    Maintain a fixed MIG instance count and configure Cloud Monitoring alerts to trigger automated GCP quota request API calls during high message queue backlog events.

Answer

Configure the MIG autoscaler based on a custom Cloud Monitoring metric tracking unacknowledged Pub/Sub messages per instance, and request regional Compute Engine resource quota increases in advance.
For I/O-bound queue consumers, CPU load remains low even when unacknowledged message queues accumulate. Scaling based on custom Cloud Monitoring metrics (such as Pub/Sub unacknowledged message count per instance) ensures that autoscaling responds directly to workload backlog. Furthermore, requesting regional quota increases in advance ensures that autoscaling policies are not blocked by project-level quota boundaries during peak traffic windows.

Step-by-Step Solution

1
Identify workload bottlenecks
Recognize that the worker workload is I/O-bound (waiting on external network responses), making CPU utilization an ineffective signal for autoscaling.
I/O-bound processes consume minimal CPU despite significant task backlogs, causing standard CPU-based autoscalers to stay idle.
2
Select the correct autoscaling metric
Implement custom metric autoscaling based on queue depth (Pub/Sub unacknowledged message count per instance).
Queue depth accurately reflects queue backlog and workload demand for message processing applications.
3
Plan capacity and quotas
Submit regional quota increase requests well in advance of peak operational spikes.
Compute Engine quotas are enforced regionally and quota approval takes time; submitting in advance ensures the MIG autoscaler can provision required instances up to the maximum target size without hitting quota limits.

Key Concept

Queue-based Autoscaling & Pre-provisioning Quotas
Rate this question