Performance & scale#
The fleet generator exists so benchmarks are run against a real synthetic
datacenter, not a toy. Full numbers, method, and reproduction steps are in
BENCHMARKS.md;
this page is the orientation.
Hot-query latency#
End-to-end latency of the three recursive/rollup queries, measured with
hyperfine via the rackattack query <screen> CLI (a full process →
connect → query round-trip, run scripts/bench.sh):
| Query | Mean | Notes |
|---|---|---|
PowerBlastRadius | ~193 ms | heaviest — recursive walk of the whole power chain |
TraceCablePath | ~28 ms | single port-graph path, ~constant in fleet size |
ThermalHeadroom | ~12 ms | grouped aggregate over one floor |
Reproduce on your own hardware with just bench.
Query plans & index tuning#
Measured at ~100k devices with EXPLAIN ANALYZE (details in BENCHMARKS.md):
devices (role, code)composite index (migration0005) turns a role filter from a 37 ms full scan into a 0.36 ms index scan — and covers “filter by role, order bycode” so paginated, role-scoped search is an index range, not a scan.PowerBlastRadiusquery rewrite — restarting thedevice_feedsCTEFROM impactedmakes it O(blast-radius) instead of O(fleet), so it no longer scans the whole power graph as sites are added (a site-wide SPOF dropped 4.2 s → 2.8 s with identical output).
Large-scale generation#
Generation stays bounded — rows are built deterministically and inserted with
CopyFrom in FK order inside one transaction, so memory tracks one fleet in
flight, not the insert rate:
| Fleet | Devices | Rows | Gen time | Peak RSS |
|---|---|---|---|---|
--sites 10 --rows-per-floor 40 --racks-per-row 25 | ~100k | — | ~22 s | ~194 MB |
SCALE_SITES=20 SCALE_ROWS=40 SCALE_RACKS=25 | ~200k | ~1.7M | ~58 s | ~351 MB |
Concurrent load harness#
An opt-in, local-capable harness generates a multi-site fleet (~1.7M rows) and hammers the hot recursive RPCs concurrently against a single-node CockroachDB. It’s excluded from the default suite and CI:
just loadtest # go test -tags scale -run TestScaleLoad (gated on RACKATTACK_TEST_DB)Headline finding under 48-worker saturation: the rollups hold up (Thermal /
Floor stay ~1 s at p99) while PowerBlastRadius dominates — it’s an
O(blast-size) incident-time query, not a high-QPS path, and 48 concurrent
whole-site walks serialize on one node. Multi-node CockroachDB is the lever for
that fan-out; see BENCHMARKS.md for the full table and analysis.