Sobes.tech
Middle+

If an application under load slows down and liveness probes timeout, what happens? Is this correct?

sobes.tech AI

Answer from AI

If an application under load starts to slow down and liveness probe timeouts occur, it means that Kubernetes considers the pod to be unhealthy. As a result, the controller restarts the pod in an attempt to restore functionality.

This behavior is correct from Kubernetes' perspective: the liveness probe is designed to detect hung or non-responsive applications. However, if the application slows down due to high load, restarting may not solve the problem and could even worsen the situation by creating additional overhead.

The correct approach:

  • Configure the liveness probe to account for acceptable delays under load (for example, increase the timeout).
  • Use the readiness probe to control when the application is ready to receive traffic, so as not to send requests to overloaded pods.
  • Optimize the application or scale the system to handle the load.

Thus, liveness probe timeouts under load are a signal of a problem, but not always the correct solution — restarting the pod.