Troubleshooting Recipe: CoreDNS 5-Second Latency Spikes & Conntrack Exhaustion
How to diagnose and eliminate intermittent 5-second DNS timeouts in Kubernetes clusters caused by Linux conntrack table exhaustion and UDP race conditions.
โWhen microservices experience exact 5-second latency spikes on external HTTP calls, the culprit is almost never the upstream APIโit is a dropped UDP DNS packet hitting glibcโs default retransmission timeout.โ
Symptom
- Application p99 latency shows sharp spikes at multiples of 5 seconds (
5.0s,10.0s). - Node kernel logs (
dmesg) reportnf_conntrack: table full, dropping packet. - CoreDNS pods show low CPU utilization despite client-side DNS timeouts.
Root Cause
High-churn pods generate thousands of short-lived UDP DNS lookups (amplified by default ndots:5 search-domain expansion). When the Linux nf_conntrack table fillsโor when parallel A/AAAA lookups race on the same source port in older kernelsโpackets are silently dropped and glibc waits 5 seconds before retrying.
Resolution Steps
- Inspect conntrack saturation on worker nodes: Run
sysctl net.netfilter.nf_conntrack_count net.netfilter.nf_conntrack_maxandconntrack -S(look for non-zeroinsert_failedordrop). - Deploy NodeLocal DNSCache: Run a local DNS cache DaemonSet on every node using TCP to upstream CoreDNS, eliminating cross-node UDP conntrack entries.
- Tune
ndotsandsingle-request-reopen: Where appropriate, setndots: 2in poddnsConfigor use FQDN trailing dots for external endpoints. - Verify: Confirm
conntrack -Sdrop counters stay flat under peak load and p99 DNS resolution returns to< 5ms.
๐ค Interrogate This Field Note in Digital Twin
Click a prompt below to immediately stream an architectural analysis from Virtual Sachin's RAG cognitive twin:
Sachin Kumar Sharma
Director (Cloud & Infrastructure Architecture) | Principal Agentic AI Architect | 20+ Yrs Exp
Architecting resilient multi-cloud enterprise landing zones, SDN overlay fabrics, DevSecFinOps automation pipelines, and autonomous Agentic AI platforms.
๐ก Related Engineering Articles
Troubleshooting Recipe: OSPF Neighbors Stuck in EXSTART/EXCHANGE Due to MTU Mismatch
Deterministic runbook for diagnosing and resolving OSPF adjacencies stuck in EXSTART/EXCHANGE across mixed-vendor WAN and datacenter links.
Troubleshooting Recipe: Resolving A2A Multi-Agent Deadlocks and Infinite Retry Loops
How to detect, break, and prevent circular delegation deadlocks and runaway token retries in Agent-to-Agent (A2A) distributed workflows.
Troubleshooting Recipe: iSCSI Multipathing APD vs. PDL Recovery on ESXi
How to distinguish All Paths Down (APD) from Permanent Device Loss (PDL) on ESXi storage fabrics and recover cleanly without rebooting healthy hosts.
๐ฌ Stay Updated on Tech Releases
Sign up to get notified when I publish new production war stories, agentic AI architecture blueprints, or open-source infrastructure tools.