Repository navigation
librtmp2-server 0.6.9
Security
- Unauthenticated RTMP connections may hold at most half of
RTMP_MAX_CONNECTIONS(at least one pre-auth slot); established publish/play
sessions keep the rest. The reservation is process-wide across poll shards,
applies to single-shard, TLS and plaintext shard shapes, and evicts the
oldest idle sockets first; a connection with an authorization in flight is
not counted as an idle squatter. A concurrent connect burst trims a
proportional share per shard instead of the full excess in every shard, so
new clients can still authenticate.
Fixed
- A retried begin-delete is fenced on the row's
created_atand a per-row
randomdelete_token, and every replica stores the same token, so a
replacement that reuses the stream id within the same second cannot be
disabled by the retry. Snapshots preserve the token map, pre-token rows
derive a deterministic identity, and the delete handler readscreated_at
and the token in one query, retrying a failed read. A later DELETE can
restart after a terminal failure. - The background finalizer re-issues the identity-fenced begin-delete before
every finalize attempt, so a write the leader dropped after the caller-side
timeout cannot leave an accepted delete half-applied. After a terminal
failure it keepspending_delete=1for startup recovery. The async 202 path
no longer re-enables the row when finalize fails; only the synchronous 500
path rolls the disable back. - A node-ownership release adds one repair pass bounded by the release's own
apply index, so rows that were committed but not yet applied on the caller's
node no longer survive the release. A release or cleanup is fenced by epoch
and log index, and a failed ownership read neither queues an unfenced cleanup
nor retries a release whose hydration failed. - Cluster play refs are tracked per player session and per standby replica.
Epoch-only changes keep the existing refs, a same-stream replay unsubscribes
and re-subscribes the session, and a resubscribe tick no longer leaks a ref. - The health loop no longer awaits the bandwidth probe. Overlapping probes are
guarded, the PowerShell call is bounded by a deadline and takes its command
by mutable reference so the server builds on Windows, the sampling interval
is measured from real samples, and the adapter name is escaped. - A cluster bind on port 0 is rejected, a port-only bind is normalized before
it is advertised, and a valid advertised address spelling is preserved for
join proofs. - A rolled-back auth group closes its connection through the normal poll path,
roles revoked by the protocol layer are released in the same poll pass, the
ownership tracker survives a failed database read, and forwarded Raft writes
are bounded by the local write timeout. - Forwarded membership changes run in a detached task; the caller's wait stays
bounded and a timed-out transition is not cancelled. - Malformed JSON request bodies return the API error envelope.
Changed
- Built on librtmp2 0.17.0.
- Raft voters must run the same build before the delete and ownership fences
are relied on: an older voter ignores the new serde-defaulted fence fields
and falls back to the previous behavior. - The benchmark sweep compares against the stable SRS release v6.0-r3.
- The Docker runtime image uses Alpine 3.24.4.
- Dependency updates: cc 1.11.1, mime 0.3.18, smallvec 1.16.5, toml_edit
0.25.19, winnow 1.0.5.
What's Changed
- chore(deps): update sonarsource/sonarqube-scan-action action to v8.4.1 by @renovate[bot] in #348
- chore(deps): update taiki-e/install-action digest to c114f6e by @renovate[bot] in #346
- chore(deps): update taiki-e/install-action digest to 7ba3421 by @renovate[bot] in #350
- ci(bench): compare against the stable SRS release v6.0-r3 by @AlexanderWagnerDev in #349
- fix: auth rollback, role release and cluster control hardening by @AlexanderWagnerDev in #347
- fix(security): harden pre-auth slots and delete/ownership fences by @AlexanderWagnerDev in #351
- chore(deps): update taiki-e/install-action digest to 61b1602 by @renovate[bot] in #352
- chore(deps): update docker/login-action action to v4.8.0 by @renovate[bot] in #355
- chore(deps): update softprops/action-gh-release action to v3.0.4 by @renovate[bot] in #354
- chore(deps): update alpine docker tag to v3.24.4 by @renovate[bot] in #356
- fix(delete): keep accepted deletes recoverable after a terminal failure by @AlexanderWagnerDev in #353
- fix(rtmp): share the pre-auth excess across poll shards by @AlexanderWagnerDev in #357
- chore(deps): update taiki-e/install-action digest to db07720 by @renovate[bot] in #358
- Release 0.6.9 by @AlexanderWagnerDev in #359
Full Changelog: v0.6.8...v0.6.9
Benchmarks
Measured automatically for this release on a CI runner; the machine is described below. Raw data: bench-results-v0.6.9.json.
- Measured: 2026-11-06 23:41:36 UTC ·
e1e59b1· crate version 0.6.9 · workflow run - Built on: librtmp2 0.17.0
- CPU: AMD EPYC 7763 64-Core Processor · 4 vCPUs
- RAM: 15.6 GiB
- System: Linux 7.0.0-1019-azure x86_64 · rustc 1.99.1 · GitHub-hosted ubuntu26 (image 20261101.186.1)
- Noise: shared CI VM — CPU model, neighbouring load and the runner image change between runs, so treat absolute numbers as indicative.
- Comparable vs release v0.6.8: ❌ different hardware (AMD EPYC 9V45 96-Core Processor, 4 vCPUs vs AMD EPYC 7763 64-Core Processor, 4 vCPUs): only large changes (> 25 %) mean anything
http_api
| Benchmark | Time | Throughput | vs release v0.6.8 |
|---|---|---|---|
http_api/create_stream |
276.71 µs | — | 🔴 +118.1 % |
http_api/health |
166.30 µs | — | 🔴 +97.1 % |
http_api/list_streams |
11.4 ms | — | 🔴 +86.4 % |
🟢 faster · 🔴 slower · ⚪ within the noise band (5–25 % depending on how comparable the two environments are, plus both runs' Criterion confidence intervals). Lower time is better.
Cross-server sweep
Same RTMP client and ffmpeg source for every server, one server at a time: load viewers 500 1000 2000, publisher ffmpeg 1280x720@30 H.264 2.5 Mbps + AAC 128 kbps. One sweep per run, no repetitions — the shared runner makes single values noisy, so compare servers within this run rather than across runs.
Servers: librtmp2-server 0.6.9 (librtmp2 0.17.0) · MediaMTX v1.21.3 · nginx-rtmp nginx 1.31.8 (nginx-rtmp-module @ 6c7719d)
librtmp2-server vs the baselines
| Metric | Now | vs release v0.6.8 |
|---|---|---|
| publish handshakes/s | 6,382 | 🔴 −43.5 % |
| publish handshake avg (ms) | 3.61 | 🔴 +66.4 % |
| publish handshake p95 (ms) | 8.56 | 🔴 +83.7 % |
| play handshakes/s | 5,713 | 🔴 −47.8 % |
| play handshake avg (ms) | 3.38 | 🔴 +61.0 % |
| play handshake p95 (ms) | 6.76 | 🔴 +30.8 % |
| join, 1 viewer: avg (ms) | 0.55 | ⚪ +22.2 % |
| join, 1 viewer: p95 (ms) | 0.55 | ⚪ +22.2 % |
| join, 25 viewers: avg (ms) | 2.74 | 🔴 +132.2 % |
| join, 25 viewers: p95 (ms) | 3.63 | 🔴 +113.5 % |
| join, 100 viewers: avg (ms) | 5.44 | 🔴 +156.6 % |
| join, 100 viewers: p95 (ms) | 10.65 | 🔴 +114.7 % |
| load, 500 viewers: join avg (ms) | 21.49 | ⚪ −13.2 % |
| load, 500 viewers: join p95 (ms) | 48.02 | ⚪ −0.6 % |
| load, 500 viewers: frames/viewer | 73.68 | ⚪ +0.0 % |
| load, 500 viewers: CPU (% of one core) | 35.70 | 🔴 +29.8 % |
| load, 500 viewers: peak RSS (MiB) | 23.20 | ⚪ −3.3 % |
| load, 1000 viewers: join avg (ms) | 45.19 | 🔴 +30.3 % |
| load, 1000 viewers: join p95 (ms) | 123.7 | 🔴 +65.3 % |
| load, 1000 viewers: frames/viewer | 73.64 | ⚪ −0.0 % |
| load, 1000 viewers: CPU (% of one core) | 70.50 | 🔴 +29.8 % |
| load, 1000 viewers: peak RSS (MiB) | 33.50 | ⚪ −2.0 % |
| load, 2000 viewers: join avg (ms) | 136.5 | 🔴 +245.3 % |
| load, 2000 viewers: join p95 (ms) | 294.8 | 🔴 +127.7 % |
| load, 2000 viewers: frames/viewer | 73.65 | ⚪ +0.0 % |
| load, 2000 viewers: CPU (% of one core) | 133.0 | 🔴 +28.5 % |
| load, 2000 viewers: peak RSS (MiB) | 54.30 | ⚪ +0.6 % |
Handshake latency
| Server | publish /s | avg ms | p95 | p99 | play /s | avg ms | p95 | p99 |
|---|---|---|---|---|---|---|---|---|
| librtmp2-server | 6,382 | 3.61 | 8.56 | 10.49 | 5,713 | 3.38 | 6.76 | 8.06 |
| MediaMTX | 5,203 | 4.49 | 7.02 | 8.64 | 3,779 | 5.84 | 10.00 | 11.11 |
| nginx-rtmp | 691.9 | 41.87 | 43.35 | 43.82 | 352.0 | 83.46 | 85.95 | 87.10 |
Join latency (avg / p95 ms)
| Server | 1 viewer | 25 viewers | 100 viewers |
|---|---|---|---|
| librtmp2-server | 0.55 / 0.55 | 2.74 / 3.63 | 5.44 / 10.65 |
| MediaMTX | 0.91 / 0.91 | 4.00 / 5.13 | 12.26 / 20.82 |
| nginx-rtmp | 81.63 / 81.63 | 83.99 / 85.09 | 85.05 / 87.89 |
Many viewers on one stream
| Viewers | Server | join avg / p95 ms | CPU % (one core) | peak RSS MiB | frames/viewer |
|---|---|---|---|---|---|
| 500 | librtmp2-server | 21.49 / 48.02 | 35.70 | 23.20 | 73.68 |
| 500 | MediaMTX | 68.00 / 106.7 | 112.3 | 99.60 | 73.60 |
| 500 | nginx-rtmp | 113.5 / 141.8 | 59.80 | 21.40 | 73.59 |
| 1000 | librtmp2-server | 45.19 / 123.7 | 70.50 | 33.50 | 73.64 |
| 1000 | MediaMTX | 141.6 / 249.8 | 206.6 | 168.2 | 73.67 |
| 1000 | nginx-rtmp | 146.4 / 202.9 | 89.50 | 27.30 | 55.07 |
| 2000 | librtmp2-server | 136.5 / 294.8 | 133.0 | 54.30 | 73.65 |
| 2000 | MediaMTX | 583.5 / 2,437 | 199.8 | 311.7 | 37.87 |
A competitor delivering fewer frames per viewer than the others was overloaded at that step (the delivered rate, not just latency, is the result).