FULL AI ANALYSIS

Kubernetes liveness probe kills Spring Boot JVM pod during G1 GC pauses — pods restart under moderate load

Generated Oct 24, 2026, 9:21:01 AM

Analysis summary

Primary cause: liveness probe too strict relative to JVM stop-the-world GC pauses and occasional CPU throttling; the probe times out while GC pauses block the health endpoint, so Kubernetes perceives an unhealthy pod. Evidence: GC durations exceed probe timeout and raising CPU requests reduced frequency. Secondary causes include insufficient CPU share leading to throttling under bursty load and synchronous health-check code path that blocks during GC. Solutions combine probe tuning, JVM GC tuning, and resource sizing. Implementing readiness probe semantics and making the health endpoint lightweight/async reduces false positives.

Possible causes

Liveness probe timeout too low relative to transient stop-the-world GC pauses

90%

CPU throttling due to low resource requests causing longer GC pauses

55%

Blocking/expensive work performed inside the /health endpoint causing additional delays

40%

Rare deadlock in application code causing endpoint unresponsiveness (less supported by traces)

15%

Suggested fixes

1

Diagnostic step 1

Replace the liveness probe with a lightweight, non-blocking endpoint (e.g., /health/liveness that returns 200 immediately) and use a separate readiness probe for deeper checks.

2

Diagnostic step 2

Increase liveness timeoutSeconds to at least 3s and failureThreshold to 5 during rollout; measure impact before fine-tuning downwards.

3

Diagnostic step 3

Adjust JVM and container resources: raise CPU request to avoid throttling and set -XX:MaxGCPauseMillis=200; test with load to validate GC pause distribution.

4

Diagnostic step 4

Instrument GC logs (-Xlog:gc*:file=/tmp/gc.log:time) and collect kubelet/container metrics during bursts to correlate pauses, then iterate on resource vs GC tuning.

5

Diagnostic step 5

If needed, employ provisioned concurrency or more replicas to smooth load and reduce per-pod burstiness.