Skip to content

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

Fly.io 10 min read Case study hardMaster

Throwing Out The Phonebook

Fly.io rebuilt 6PN, its private IPv6 network between Fly Machines, replacing a fleet-wide eBPF map of every migrated Machine's location (hundreds of thousands of entries kept in sync from Corrosion's gossip-replicated SQLite) with lazy, on-demand routes. VXLAN's netlink event for unknown addresses is passed through drift-agent to s6pnforwarderd, which queries local Corrosion and installs a single kernel route. Each host now carries only 100–200 routes, addresses no longer need rewriting, and routes can forward through intermediate hosts to tolerate stale entries or steer around bad links. udp-xdp now only validates same-network traffic and sets an fwmark so the design fails closed. The costs are a roughly one-second first-connection delay from TCP retransmission and broken new conversations if the daemons crash. The migration ran both paths side by side behind per-host flags, tolerating asymmetric routing.

Assumes: IPv6 addressingLinux routing tableseBPF/XDP basicsWireGuard and VXLAN

Related posts

  • Well, That Wasn't Fun: October 16 '26

    Fly.io mediumAdept

    A Linux kernel bug in IPv4 checksum offload validation let a guest VM direct the host to write its computed checksum into an already-trusted IPv4 header field. This enabled a firewall bypass and a 32-byte out-of-bounds read that could leak host memory or packets from neighboring VMs. XDP rules ran too early to catch the rewrite, and disabling offload required a reboot anyway, so Fly.io patched and rebooted its entire fleet in 10 hours. Reboots were sequenced in waves so no Managed Postgres cluster lost both nodes (17 waves in iad), with some hosts stuck in BIOS or lost to a failed power supply. The write-up also covers the decision to label the work as 'maintenance' rather than disclose vulnerability, the move of incident comms to the exec team, and advice to encrypt internal traffic, scope and expire agent credentials, and rehearse rotation.

  • Hello, World: We’re Railway

    Railway mediumAdept

    Railway launches US-East, EU-West and Southeast Asia regions alongside its original US-West GCP zone, with one-click region moves that need no URL or DNS changes. Getting there required several building blocks: private networking built on a WireGuard mesh with eBPF NAT and per-project IPv6 /64 address spaces, a global edge that splits Envoy edge proxies from regional routing proxies behind GeoDNS, and lazy-loading L4 TCP proxies that subscribe to a memdb-backed control plane for cache invalidation. Volumes use ZFS send/receive snapshots, orchestrated with Temporal, to move databases across regions with minimal downtime. The team also restructured a copy-pasted, module-less Terraform and Ansible stack so new regions are cheap to add.

  • Corrosion

    Fly.io mediumAdept

    Corrosion is Fly.io's open-source service discovery system: a Rust program that propagates a SQLite database across thousands of workers via SWIM gossip and QUIC, using the cr-sqlite CRDT extension with last-write-wins logical timestamps instead of distributed consensus. It works because Fly's orchestration makes individual workers the source of truth for their own state, so updates rarely conflict, much like a link-state routing protocol such as OSPF. The war stories cover a Rust RwLock deadlock gossiped to every proxy that caused a fleet-wide outage, a nullable-column migration that triggered a cr-sqlite backfill storm, and Consul certificate expiry that drove Corrosion writes until uplinks saturated. The fixes are Tokio event-loop watchdogs, Antithesis testing, checkpoint backups for cluster rebuilds, republishing full Machine state instead of partial updates, and regionalized two-level clusters to shrink the blast radius.

  • Networking is a black box, we used eBPF to open it

    Railway mediumAdept

    Railway's Network Flows feature uses eBPF hooks on container packet ingress and egress to show real-time traffic between services as pipes on the project canvas, with click-through access to flow logs and kernel drop codes. Raw socket buffers are enriched with ports, addresses, cgroup-to-service and peer-service lookups, batched at 10,000 flows, and written to ClickHouse at roughly a million rows per second. The first design had about a thousand hosts writing directly to ClickHouse, and ReplacingMergeTree merge overhead degraded the cluster. An intermediate ingestion service that cut the writers to three and made inserts far larger fixed it. The feature was motivated by support tickets blaming the platform network for what were almost always application misconfigurations.

  • Incident Report: July 2, 2026 — US East Services Outage

    Railway mediumAdept

    An upstream Tier 1 carrier's backbone degradation caused packet loss between Railway's US regions, and while routing around it, engineers disconnected the last carrier supplying a default route to a first-generation US East site, leaving it without a stable internet route for about 20 minutes. That instability exposed latent bugs: Linux hosts fell back to a slow management network for storage traffic, and connections stayed pinned there after recovery, capping throughput at a third and pushing I/O wait to 58%. WireGuard-style mesh tunnels also learned a NAT device's address as their peer and, being silent when idle, never self-corrected, blackholing about 20,000 links until agents were restarted. Fixes include self-generated default routes at older sites, making missing fabric routes fail closed instead of falling back, and alerting on management-network utilization and blackholed links.

The quest for software engineering knowledge.

Look:
Layout: