Skip to main content

One post tagged with "scalability"

System scaling, capacity design, incremental updates, and large-scale onboarding.

View all tags

Headscale Cluster Architecture for Large-Scale Device Onboarding

· 5 min read
Larktun Contributor

Standard headscale is designed as a single-node control plane backed by SQLite or PostgreSQL. That architecture is simple to self-host, but when device counts grow into the thousands across many independent users, a single Headscale instance hits hard ceilings in concurrent long-lived map streams, database write contention, and full netmap recalculations.

This article outlines the architecture used to evolve headscale from a single monolith into a horizontally scalable cluster: cluster_id logical sharding, shared PostgreSQL storage, an Admission and Control Service (ACS), mandatory query isolation, and incremental netmap rebuilds.