Skip to content

feat(relay): make capacity controls observable - #122

Merged
abruption merged 1 commit into
chore/115-control-migrationsfrom
feat/114-relay-capacity-metrics
Sep 21, 2026
Merged

abruption merged 1 commit into
chore/115-control-migrationsfrom
feat/114-relay-capacity-metrics

Conversation

@abruption

Copy link
Copy Markdown
Owner

The hosted relay kept fixed Alpha-era limits and its authenticated API retained every user rate bucket for the life of the process. This change preserves the existing defaults while making them explicit, validated safety bounds; bounds and cross-limit relationships fail closed at startup.

The Python relay now distinguishes handshake rate pressure (429) from pending-session and connection capacity (503), without burning a fresh admission proof or discarding an issued one-use session. It tracks only non-identifying aggregate counters and serves them from a separate 127.0.0.1 metrics listener. The control service validates that fixed schema and merges it only into the dedicated Authelia-protected admin listener. The public relay hostname receives no metrics route. User rate buckets are capped and expired deterministically.

The KR reference retains the current limits (20 handshakes/s, 100 pending sessions, 10 global, 8/user, 4/device, 32 MiB/direction), adds the loopback metrics wiring and admin capacity cards, and documents how those limits fit below the 256 MiB/64-task/256-FD unit envelope. Generic sizing guidance treats limits as safety bounds rather than user-count guarantees.

Validation:

  • Python full suite: 434 passed, 6 optional/platform skips
  • actual Node/Python control integration: 6 passed
  • Node 22.14.0: clean install, typecheck, build, 78 tests
  • Node 24.16.0: clean install, typecheck, build, 78 tests, runtime audit 0
  • real loopback WebSocket load covers delivery, global saturation, cleanup and recovery
  • focused saturation tests cover 429/503, pending proof preservation, global/user/device limits, waiting cleanup and byte budget
  • documentation i18n contract and admin HTML JavaScript syntax passed

This PR is stacked on #121 so the capacity configuration uses the versioned control schema introduced there.

Closes #114

@abruption
abruption force-pushed the chore/115-control-migrations branch from 02e6a8f to 2e72b26 Compare September 21, 2026 01:59
@abruption
abruption force-pushed the feat/114-relay-capacity-metrics branch from b7028bc to 517d730 Compare September 21, 2026 01:59
@abruption
abruption force-pushed the chore/115-control-migrations branch from 2e72b26 to bee4634 Compare September 21, 2026 02:01
@abruption
abruption force-pushed the feat/114-relay-capacity-metrics branch from 517d730 to 320edab Compare September 21, 2026 02:01
@abruption
abruption force-pushed the chore/115-control-migrations branch from bee4634 to 82da76c Compare September 21, 2026 02:03
@abruption
abruption force-pushed the feat/114-relay-capacity-metrics branch from 320edab to 0bd0fc9 Compare September 21, 2026 02:03
@abruption
abruption force-pushed the chore/115-control-migrations branch from 82da76c to d52fdf3 Compare September 21, 2026 05:36
@abruption
abruption force-pushed the feat/114-relay-capacity-metrics branch from 0bd0fc9 to 5a62090 Compare September 21, 2026 05:36
@abruption
abruption merged commit 18fa729 into chore/115-control-migrations Sep 21, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant