Linora

0801. Load generator: raw-socket Node workers, ADR 0020 load model, latency timestamps in payloads

Status: Accepted (2026-11-27). Work package H (load test). Code: tools/loadtest/.

Context

WP-H must prove ADR 0020’s capacity table with 100k+ WebSockets. That means a generator cheap enough that it is not the bottleneck, behaving like the real sync client: auth, hello/subscribe, resends, reconnects. It must measure latency end to end across processes, and check validation verdicts, not only throughput. ADR 0020 gives the load model in prose (“20% editors”, “80% view”), which leaves room for interpretation.

Decision

Generator. A coordinator (run.ts) spawns N worker processes (worker.ts), JSON lines over stdin/stdout.

Load model (profile adr0020, scaled linearly below 100k).

Latency. Timestamps travel in the payloads, on a clock shared by the processes on one host (performance.timeOrigin + now(), relative to a run epoch).

Report. Acceptance table first, then setup, ramp and idle memory (after a forced GC through the server’s SIGUSR2 hook, raw RSS shown too), per-window latency, server and generator tables, kill and storm timelines. The JSON next to it holds samples and histogram buckets. Presence is judged on rooms up to 200 subscribers; rooms above that tick every 200 ms by design (ADR 0007) and are reported separately. Runs below 100k mark scale-dependent checks n/a and show linear projections.

Scenarios.

Alternatives

Consequences