PROFESSIONAL-CLOUD-DEVOPS-ENGINEER practice question 9 of 25

[Optimizing service performance] You manage a retail website for your company. The website consists of several microservices running in a GKE…

Full set: 205 questions
[Optimizing service performance] You manage a retail website for your company. The website consists of several microservices running in a GKE Standard node pool with node autoscaling enabled. Each microservice has resource limits and a Horizontal Pod Autoscaler configured. During a busy period, you receive alerts for one of the microservices. When you check the Pods, half of them have the status OOMKilled, and the number of Pods is at the minimum autoscaling limit. You need to resolve the issue. What should you do?
Answer options
A: Increase the memory resource limit of the microservice. Correct answer
B: Increase the maximum number of nodes in the node pool.
C: Increase the maximum replica limit of the Horizontal Pod Autoscaler.
D: Update the node pool to use a machine type with more memory.
Correct Answer:
A. Increase the memory resource limit of the microservice.
Explanation

The OOMKilled status indicates that a container's process was terminated because it exceeded its configured memory limit. The fact that this is happening during a busy period suggests the application requires more memory under heavy load than it has been allocated. Increasing the memory resource limit for the microservice's container specification directly addresses the root cause of the crashes. This will allow the Pods to handle the increased load without being terminated, stabilizing the service and allowing the Horizontal Pod Autoscaler to function correctly if CPU-based scaling is also needed.

Why Incorrect

B. Increasing the maximum number of nodes helps if Pods are pending due to a lack of cluster resources, not when existing Pods are crashing due to their own limits.
C. The Horizontal Pod Autoscaler is not scaling up because the Pods are crashing before the scaling metric (e.g., CPU) can reach its threshold. The memory limit is the primary issue.
D. A node with more memory does not change the individual memory limit applied to a container. A Pod with a 512Mi limit will still be killed if it exceeds that limit, even on a 64GiB node.

References

1. Kubernetes Documentation

"Resource Management for Pods and Containers"

Section: "How Pods with resource limits are run". It explains

"If a container exceeds its memory limit

it might be terminated. If it is restartable

the kubelet will restart it

as with any other type of runtime failure." This describes the OOMKilled behavior.

2. Google Cloud Documentation

GKE

"Troubleshooting GKE"

Section: "Pods are crash-looping". The guide lists OOMKilled as a common reason and suggests solutions like "Increase memory requests and limits" and "Profile your application's memory usage to understand its requirements." This directly supports increasing the memory limit.

Scroll to Top