Member-only story
499 new links made the network count 608x slower
It worked in dev · Episode 18 · technique: connected components, one sweep
How many separate networks are in the service mesh — groups of services that can reach each other and nothing outside? The platform team runs it after every routing change, to catch a cluster that has been cut off.
With 500 teams running their own clusters, it took 2.82 ms. Then the teams added 499 cross-team links, one each, so the whole mesh became one network. Same 5,000 services. The count took 1.71 seconds, and allocated 1.97 GB to return the number 1.
The problem
// adj[s] holds every service s has a link with. Links are two-way.
type Mesh [][]intCount the networks: the groups where every service can reach every other one, directly or through others, and none can reach a service outside the group.
What you would write
The admin UI already had a blast-radius page: pick a service, see everything a failure in it could reach. So Reachable existed, and it was tested:










