PROFESSIONAL-CLOUD-DEVOPS-ENGINEER · Question #56
You are the on-call Site Reliability Engineer for a microservice that is deployed to a Google Kubernetes Engine (GKE) Autopilot cluster. Your company runs an online store that publishes order…
The correct answer is C. Increase the number of Pod replicas. To handle an increased volume of Pub/Sub messages caused by a sales event and speed up stock updates, you should increase the number of Pod replicas for the microservice consuming the messages.
Question
Exhibit
Options
- ADecrease the acknowledgment deadline on the subscription.
- BAdd a virtual queue to the online store that allows typical traffic levels.
- CIncrease the number of Pod replicas.
- DIncrease the Pod CPU and memory limits.
How the community answered
(44 responses)- A2% (1)
- B16% (7)
- C75% (33)
- D7% (3)
Why each option
To handle an increased volume of Pub/Sub messages caused by a sales event and speed up stock updates, you should increase the number of Pod replicas for the microservice consuming the messages.
Decreasing the acknowledgment deadline on the subscription would cause messages to be redelivered more quickly if not acknowledged, potentially overwhelming the microservice further.
Adding a virtual queue to the online store would only delay the problem by limiting new orders, rather than solving the underlying bottleneck of the microservice's inability to process existing messages fast enough.
An increase in orders indicates a higher volume of messages being published to Pub/Sub, leading to a backlog if the consuming microservice cannot process them fast enough. Increasing the number of Pod replicas (scaling out) allows the GKE Autopilot cluster to run more instances of the microservice concurrently, distributing the message processing workload and significantly increasing throughput to keep up with the demand and update stock information more quickly.
Increasing the Pod CPU and memory limits (scaling up) would only help if individual pods are resource-constrained and bottlenecked on processing single messages; for an increase in overall message volume, scaling out with more replicas is generally the more effective and appropriate solution.
Concept tested: GKE Autopilot scaling and Pub/Sub consumer patterns
Source: https://cloud.google.com/kubernetes-engine/docs/concepts/horizontalpodautoscaler
Topics
Community Discussion
No community discussion yet for this question.
