Medium1 markMultiple Choice
Subtask 4.1: Technical ProcessesCompute EngineAutoscalingPub/SubMIGs

GCP PCA · Question 34 · Technical Processes

You are managing a fleet of Compute Engine instances in a Managed Instance Group (MIG). The application processes messages from a Cloud Pub/Sub topic. Traffic is highly variable. You want the MIG to scale out when there is a backlog of messages and scale in when the queue is empty. How should you configure the autoscaler?

Answer options:

A.

Configure the autoscaler to scale based on CPU utilization.

B.

Configure the autoscaler to scale based on HTTP load balancing capacity.

C.

Configure the autoscaler to scale based on the Cloud Monitoring metric for Pub/Sub unacknowledged messages.

D.

Write a custom script that runs on a cron job to check the queue size and manually adjust the MIG size.

How to approach this question

Identify the autoscaling signal that directly measures the queue backlog.

Full Answer

C.Configure the autoscaler to scale based on the Cloud Monitoring metric for Pub/Sub unacknowledged messages.✓ Correct
For worker nodes processing a queue, CPU is often a poor scaling metric (e.g., if workers are blocked waiting for a database, CPU is low, but the queue is growing). The best practice is to autoscale based on the actual backlog. GCP allows MIGs to autoscale based on any Cloud Monitoring metric, including `pubsub.googleapis.com/subscription/num_undelivered_messages`.

Common mistakes

Defaulting to CPU autoscaling, which is best for compute-bound web servers, not queue workers.

Practice the full GCP Professional Cloud Architect Practice Exam 1

50 questions · hints · full answers · grading

More questions from this exam