Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 18 min read Incident hardMaster

AWS CNI lessons from a Production Outage

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.

Related posts

  • Postmortem: Delayed Start Compute Operations

    Neon mediumAdept

    A query plan change overloaded Neon's control plane database in AWS us-east-1, which stopped it from suspending idle databases. Running pods climbed to about 8,000, and those pods used up the IP addresses in two of the three subnets, so customers couldn't create or wake scale-to-zero databases for 5.5 hours across two days. Mitigation meant upscaling the control plane database, adding temporary proxy rate limiting, and setting the AWS CNI WARM_IP_TARGET and WARM_ENI_TARGET to 0. Restoring WARM_IP_TARGET=1 three days later caused IP allocation to fail again even though free IPs were available, and that was eased by doubling prewarmed compute pools. Follow-ups include doubling the VPC subnets and a new Kubernetes 'Cells' architecture.

  • It’s always DNS . . . except when it’s not: A deep dive through gRPC, Kubernetes, and AWS networking

    Datadog Engineering hardMaster

    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.

  • Not just another network latency issue: How we unraveled a series of hidden bottlenecks

    Datadog Engineering mediumAdept

    Recurring 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.

  • 2023-03-08 incident: A deep dive into the platform-level recovery

    Datadog Engineering hardMaster

    Recovering from Datadog's March 8, 2023 multi-region outage, triggered by a systemd-networkd patch on Ubuntu 22.04 that cut network connectivity for nodes running Cilium, required restoring Kubernetes clusters in a strict order: parent control planes, then child control planes hosted on parent nodes, then application nodes. In EU1 (Google Cloud), impacted nodes could simply be rebooted. Scaling out to drain the backlog then hit a 15,500-instance network peering group limit and full pod subnets in three clusters, which normally run at around 40% IP usage. In US1 (AWS), Auto Scaling groups replaced tens of thousands of instances, so every node had to re-register through Vault, the Kubernetes API, and Cilium ENI/IP allocation via EC2 APIs, stressing those services and slowing the return to Ready capacity.

  • 2023-03-08 incident: A deep dive into the platform-level impact

    Datadog Engineering hardMaster

    A 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.

The quest for software engineering knowledge.

Look:
Layout: