FULL AI ANALYSIS

Kubernetes nodes with kube-proxy in IPVS mode cause long-lived TCP connections to stall when conntrack entries exceed kernel limit

Generated Oct 17, 2026, 9:26:12 AM

Analysis summary

The kernel conntrack table reaching its max and log messages indicating table full strongly point to conntrack exhaustion as a primary contributor. IPVS relies on conntrack for NAT-ed service flows; when conntrack entries are dropped, existing long-lived flows can hang because replies are no longer associated with a conntrack entry. The fact that switching to iptables on a test node avoided the problem suggests an IPVS/conntrack interaction issue or differences in connection lifetime handling. Raising nf_conntrack_max reduced frequency but did not cure the root cause, indicating either leaks (entries not expiring due to timeouts or stuck entries), an IPVS bug preventing normal conntrack GC, or application behavior creating an excessive number of half-open/long-lived ephemeral flows.

Possible causes

Conntrack table saturation due to high number of connections and insufficient nf_conntrack_max / timeouts, causing kernel to drop or not track new/existing flows

80%

IPVS + conntrack interaction bug in the kernel or ip_vs module causing orphaned conntrack entries or preventing GC of certain connection states (e.g., UNREPLIED), especially under heavy churn

55%

kube-proxy misconfiguration (e.g., overly long timeouts, Service/sessionAffinity settings, or NodePort churn) producing many ephemeral flows that exhaust conntrack

40%

Application-layer keepalive/heartbeat behavior preventing connections from being marked idle, inflating steady-state conntrack counts

25%

Suggested fixes

1

Diagnostic step 1

Monitor /proc/sys/net/netfilter/nf_conntrack_count and nf_conntrack_max closely alongside connection churn metrics (Connections/s, new flows) to correlate peaks to stalls. These are read-only sysfs metrics and safe to read.

2

Diagnostic step 2

Dump conntrack entries (conntrack -L) at times of failure and inspect for many UNREPLIED or TIME_WAIT entries; export a sample (redact IPs if sending to vendors) and look for patterns tied to specific services or source ranges.

3

Diagnostic step 3

Temporarily adjust nf_conntrack_max upward on a single node and observe if stalls disappear; this is reversible (sysctl -w). If that helps, consider a controlled cluster-wide increase with capacity planning and memory checks (conntrack uses kernel memory).

4

Diagnostic step 4

Tune nf_conntrack_tcp_timeout_established and shorter TCP timeouts for your workload to reduce resident entries for truly idle, long-lived connections; test on a non-production node first because this changes connection lifetime behavior.

5

Diagnostic step 5

As a diagnostic, put a single node in iptables mode (kube-proxy mode swap) and run load tests to confirm IPVS-specific behavior. This requires kube-proxy restart for that node but can be done one node at a time to avoid cluster-wide disruption. If iptables avoids the issue, gather kernel versions and module versions for escalation to kernel maintainers or distro support with evidence (conntrack dumps, ipvsadm output). Escalate to your OS vendor or kernel support when conntrack entries persist despite reasonable timeout tuning and NF_CONNTRACK increases; provide sanitized conntrack dumps and dmesg logs. Avoid sharing any sensitive client IPs or payloads when opening support tickets — anonymize or hash identifiers.