Fly.ioProblem & solution
Building clusters with serf, my new favorite thing
Summary
The post builds a geographically distributed Headless Chromium cluster on Fly.io and uses it to examine the limits of DNS-based service discovery. It first deploys Chromium in a Singapore Firecracker VM, secures Chrome Debug Protocol access by enabling Fly's private 6PN network and connecting through WireGuard, then scales instances across Singapore, Sydney, Paris, and Chile. Because DNS provides only snapshots and no convenient change notifications, each node runs a leaderless Serf agent bound to its private IPv6 address, tags members by role and region, and joins peers discovered through internal DNS. Serf then supplies an up-to-date membership map, RTT and Vivaldi-based nearness information, plus events and queries; the post concludes that it is simpler than Consul or Zookeeper and more capable than DNS for this setup.
Context
The cluster needs to run Headless Chromium instances in multiple locations and select among them. Internal DNS can reveal current members, but it provides a snapshot without a good way to receive automatic updates when membership changes.
Approach / What changed
The setup enables Fly's private 6PN network and WireGuard access, then runs a WAN-mode Serf agent on every node. Agents bind to private IPv6 addresses, advertise role and region tags, and use internal DNS only to discover initial peers. Serf maintains membership and supports queries, events, and network-nearness information.
Takeaways
Fly.io can deploy Headless Chromium as a Firecracker VM and scale instances across Singapore, Sydney, Paris, and Chile.
Serf agents use private IPv6 addresses, WAN mode, and role and region tags to maintain a leaderless membership view across nodes.
Serf's Vivaldi implementation provides relative network-nearness estimates, while its events and queries support cluster-wide messaging and responses.
Source and freshness
- Source
- fly.io
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.