New Three new products: fordway trading ERP, UEPS cloud rendering and WPECS delivery and operations View products →

1,000 viewers at about 300 ms p99: how UEPS is load tested, what it measured, and what to monitor

Engineering By SREYUN 0 views

Pixel Streaming picture quality depends on the UE application and the GPU. What the platform controls is how long a viewer waits from opening the page to receiving stream negotiation, how many viewers it can carry at once, and whether problems are noticed in time. This article explains how UEPS measures those things.

What to measure: negotiation latency

Once a viewer connects to signaling, the platform has to decide on queueing, assign an instance (starting a new one if needed) and relay UE's offer to the browser. We use the time from "viewer connects" to "offer received" as the core platform metric: it is independent of UE rendering and bandwidth and directly reflects the efficiency of signaling, scheduling and event handling.

How to measure: no real UE needed

The project's load test script, test/load/platform-load.js, simulates agents and viewers: a simulated agent reports "started" as soon as it gets a start command, a simulated UE connects to the platform and answers viewers, and simulated viewers connect to signaling and record when they get an offer. The script temporarily disables the viewer connection rate limit during the test and restores it afterwards.

NODE_TLS_REJECT_UNAUTHORIZED=0 node test/load/platform-load.js \
  --admin http://127.0.0.1:88 --public wss://127.0.0.1:443 \
  --user admin --password '<password>' --agents 20 --players 300 --rate 100

Through nginx, a single source IP is limited by nginx's limit_conn 500; for larger runs, target the viewer port directly (--public ws://127.0.0.1:8088).

Results

The test server was an 8-core Debian 13 machine with 31 GB of memory, shared with a dozen other application containers.

ScenarioResult
300 viewers over wss through nginx, one exclusive instance each300 of 300 reached negotiation, p50 230 ms / p99 328 ms; 20 simulated render machines with 14 to 16 instances each; everything reclaimed within 5 seconds after viewers left
1,000 viewers on the viewer port directly1,000 of 1,000, p50 211 ms / p99 306 ms; 50 instances per simulated machine; platform memory from 81 MB to 115 MB; reclaimed in 4.1 seconds; zero errors
Remote playback through an SSH tunnel (a single TCP path)relay/tcp, zero packet loss, about 170 ms RTT across the internet, 1280x720 adapting to bandwidth
Platform restartRunning UE processes reconnected within a second and were taken over without being relaunched

Deployment testing also uncovered and fixed two problems that only show up in real environments: agent heartbeats did not record pong replies, so an agent was wrongly marked offline about every 60 seconds and instances that were starting failed; and the connection rate limit caught several UE processes on the same render machine. The limit now applies only to viewer connections.

Where the performance comes from

  • In-memory routing and assignment: viewers, instances and agent connections live in memory, and routing and assignment are O(1) or O(number of instances).
  • Coalesced events: state changes are merged on an event bus and pushed to the console at most once a second, so more viewers never flood the console.
  • Event-driven, not polling: agents report every 5 seconds on their own, and the platform never polls render machines.
  • Lightweight storage: Node.js's built-in SQLite in WAL mode, with session history written in batches; the only runtime dependency is ws.
  • An isolated relay: TURN runs as a separate multi-worker child process, so media forwarding never competes with signaling and management for the event loop.
  • Fixed-memory time series: dashboard charts use ring buffers (every 10 seconds for the last hour, every minute for the last 24 hours), so memory use stays constant.

Metrics to watch in production

The admin port's /metrics exposes Prometheus metrics (reachable only from allowed admin subnets). The key ones:

MetricMeaning
psp_viewers / psp_viewers_queuedViewers online and in the queue; a queue that never drains means too few instances or GPUs
psp_instances_*Instances per state
psp_turn_*TURN relay status and traffic
psp_event_loop_delay_p99_msEvent loop delay; consistently above 100 means the platform is overloaded

Under System settings, Alerts, events such as a render machine going offline, an instance failing to start, insufficient resources, a growing queue, TURN problems, account lockouts and machine name conflicts can be pushed to WeCom, DingTalk, Feishu or a webhook.

Capacity planning

  • Signaling: 1,000 concurrent viewers at about 300 ms p99, with about 120 MB of platform memory.
  • Relay: about 600 Mbps per 8 cores; LAN viewers connect to UE directly and do not count.
  • Beyond what one gateway can handle, add gateways and attach different render machines to each.

Backup and day-to-day operations

The console exports a JSON backup (programs, machine settings, runtime settings and system parameters, without users or secrets), and restoring is atomic: if any entry is invalid, nothing is applied. You can also back up the data directory directly. The platform checks certificate files every minute and reloads them on change; nginx just needs a reload.

See the UEPS product page for more deployment and operations details.

Related articles