Team Performance page opens a WebSocket per instance, does not scale
- Dominant language
- JavaScript
- Stars
- 400
- Forks
- 89
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 149
Description
The Team Performance page opens a separate WebSocket connection for every running instance in the team. For teams with 100+ instances this means 100+ concurrent WebSocket connections from a single browser tab, which puts unnecessary load on both the client and the server.
The same pattern exists to a lesser degree with instance status polling on listing pages, where each instance gets its own independent polling timer hitting the REST API individually rather than using a single batched request.
## Expected Behavior
A single connection (or a small fixed number of connections) should be sufficient to stream live resource data for all instances on the page, regardless of how many instances are listed.
## Suggested Direction
The frontend already has a well-structured MQTT service with connection pooling, subscription management, and reconnect handling — currently used for device logs and device resources. This service could be extended to also cover instance resource streaming by subscribing to the relevant topics through a single shared connection, rather than opening a raw WebSocket per instance.
This would bring instance performance monitoring in line with how device monitoring already works and avoid the N-connections-per-page scaling problem entirely.
Contributor guide
Assessment
This issue has not been assessed yet.