PROFESSIONAL-CLOUD-DEVELOPER · Question #215
You have an application deployed in Google Kubernetes Engine (GKE) that reads and processes Pub/Sub messages. Each Pod handles a fixed number of messages per minute. The rate at which messages are pub
The correct answer is C. Horizontal Pod Autoscaler based on an external metric. Horizontal Pod Autoscaler (HPA) based on an external metric - specifically the Pub/Sub subscription backlog (number of undelivered messages) - directly correlates pod count with processing demand. When messages accumulate, HPA adds pods; when the backlog drains, it removes them.
Question
You have an application deployed in Google Kubernetes Engine (GKE) that reads and processes Pub/Sub messages. Each Pod handles a fixed number of messages per minute. The rate at which messages are published to the Pub/Sub topic varies considerably throughout the day and week, including occasional large batches of messages published at a single moment. You want to scale your GKE Deployment to be able to process messages in a timely manner. What GKE feature should you use to automatically adapt your workload?
Options
- AVertical Pod Autoscaler in Auto mode
- BVertical Pod Autoscaler in Recommendation mode
- CHorizontal Pod Autoscaler based on an external metric
- DHorizontal Pod Autoscaler based on resources utilization
How the community answered
(19 responses)- A5% (1)
- B5% (1)
- C79% (15)
- D11% (2)
Explanation
Horizontal Pod Autoscaler (HPA) based on an external metric - specifically the Pub/Sub subscription backlog (number of undelivered messages) - directly correlates pod count with processing demand. When messages accumulate, HPA adds pods; when the backlog drains, it removes them. This responds immediately to message bursts. Option D (HPA based on CPU/memory) is indirect: CPU spikes only after messages are already being processed, creating a lag that causes backlogs to grow before scaling kicks in. Options A and B use Vertical Pod Autoscaler, which adjusts resource limits of existing pods rather than adding new ones - this does not increase the total message throughput of the Deployment and is inappropriate for this workload pattern.
Topics
Community Discussion
No community discussion yet for this question.