It’s always DNS . . . except when it’s not: A deep dive through gRPC, Kubernetes, and AWS networking
Errors during rollouts of Datadog's metrics query service looked like DNS failures, but the root cause was VPC connection tracking saturation on AWS ENIs. Clients kept sending SYNs to deleted pods' IPs. Because Cilium had removed the pod's route and IP rule, Linux reverse path filtering treated the packets as Martian and dropped them silently, even though it was configured in loose mode. With no RST or reply, clients' gRPC reconnect logic generated around 90,000 SYNs per old IP in 90 seconds, filling the hypervisor-level VPC conntrack while the Linux conntrack stayed low. The investigation shows how ENA conntrack_allowance_exceeded metrics, VPC Flow Logs aggregated by TCP flag, and kernel route lookups exposed the interaction between NodeLocal DNSCache, Cilium ENI mode, rp_filter and gRPC clients.
Related posts
- 2023-03-08 incident: A deep dive into the platform-level impact
Datadog Engineering hardMasterA Datadog multi-region, multi-cloud outage was traced to a systemd security patch auto-installed by Ubuntu's unattended-upgrades on 22.04 hosts. The patch restarted systemd-networkd, whose v248+ behavior flushes foreign IP routing rules. That flush deleted the source-routing rules Cilium installs for pod traffic on AWS and Azure ENIs, cutting pods off. It also deleted Cilium's relocated priority-100 'lookup local' rule without restoring the default priority-0 rule, so nodes on every cloud lost network connectivity entirely. Because the unattended-upgrade timers fired in the same daily window everywhere, the change bypassed Datadog's progressive, region-by-region node replacement process; the ManageForeignRoutingPolicyRules setting can turn off the flush.
- AWS CNI lessons from a Production Outage
Neon hardMaster
Neon's us-east-1 Kubernetes cluster ran out of VPC subnet IPs at ~8k Computes despite 12k addresses, because AWS VPC CNI's default WARM_ENI_TARGET=1 behaviour over-allocates whole ENIs (49 IPs each) and only releases an ENI when it has no assigned Pods. Go's random hashmap iteration spread Pods across all ENIs, so ~3.4k IPs stayed stranded on nodes with no spare CPU or memory. The emergency fix, WARM_IP_TARGET=1, freed those IPs but then blocked Pod starts for 30s after each deletion, which kept start rates low after recovery. The write-up traces ipamd's pool logic through its source code and links an upstream PR to improve it.
- Not just another network latency issue: How we unraveled a series of hidden bottlenecks
Datadog Engineering mediumAdeptRecurring high-startup-latency pages on every deployment of Datadog's usage estimation `counter` service traced back to four stacked bottlenecks rather than one. The fixes were raising CPU for a throttled Envoy sidecar, patching a Linux kernel bug that pinned all traffic to the first of eight AWS ENA transmit queues, and moving to network-optimized EC2 instances after bandwidth-allowance-exceeded metrics revealed hypervisor packet drops. A Kubernetes preStop hook with a maintenance-mode key then kept Envoy from routing requests to terminating remote-cache pods. With p99 latency back under 100 ms, the team scaled the remote cache down 6x, saving hundreds of thousands of dollars a year, and now alerts on ENA bandwidth and pod- and host-level network drop metrics.
- Improving DNS performance with NodeLocalDNS
Neon mediumAdept
Neon deployed node-local-dns as a DaemonSet across its EKS clusters running hundreds of thousands of ephemeral Postgres pods, moving the 95%+ cache-hit DNS traffic off the network and onto each node. CoreDNS p99 latency fell from ~1.5ms to 240µs and p99.9 from 10–20ms to under 2ms, while CoreDNS load dropped 97% (~2k to ~60 req/s) and now scales with node count rather than Postgres instances. The lower load exposed NXDOMAIN amplification from a bad /etc/hosts entry, which they blackholed with the CoreDNS template plugin. A race between kube-proxy installing iptables rules for kube-dns-upstream and the DaemonSet forwarding to it caused TCP timeouts, avoided by deploying the Service before the DaemonSet (or the reverse order with Cilium Local Redirect Policy).
- Clouds, caches and connection conundrums
incident.io mediumAdeptAfter migrating to Google Cloud, sporadic Postgres and memcached connection timeouts on GKE turned out to be node-wide, not process-local. Bursts of rapidly opened TCP connections, from concurrent cache sets, GCS URL generation and a runaway query fanning out external calls, spiked CPU in the Dataplane V2 anetd agent and caused dropped packets. Partial mitigations helped: static Postgres pools with a longer connection lifespan cut new connections from ~200/s to ~1/s, and raising memcache MaxIdleConns from 2 to 20 also reduced timeouts. The lasting fix is connection reuse plus limits on outbound network concurrency rather than disabling Dataplane V2. Network timeouts should be investigated at the node level, not just per pod.