bench(moq-net): model the dash aggregator's stats load in the session bench - #4233
Conversation
… bench One session on relay 0 following every peer node's per-project stats broadcast, ~24 single-frame tracks each, swept over projects, tracks per broadcast, and peer relays, plus the 34 x 5 x 24 production point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedNext included review available in 55 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
MERGE Positive improvement. The dash aggregator's stats fan-in is a real production shape (the 2026-09-25 edge0.dal0 incident), and nothing in the session bench covered it. Modeling one session on relay 0 following every peer node's Worth the complexity. The join → connect / No better approach jumps out. A separate bench file would duplicate Ship it. This is an automated review, not the maintainer's decision |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged origin/main to resolve a conflict in (Written by Claude Opus 5.5) |
Problem
The moq.pro dash aggregator is one session following every node's
.stats/<project>/node/<node>broadcast: ~34 nodes x >=5 projects x ~24 small tracks, one single-frame group per track per 1 s tick,max_age0, all announced by peer relays. On 2026-09-25, moving that session off edge0.dal0 dropped the relay from ~129% to 40-78% of one core. Nothing benchmarked that shape.Approach
session_dash_*inrs/moq-net/benches/session.rs(from #4160): relay 0 hosts the dash session, and every other relay in the full mesh is a node publishing its per-project stats broadcasts into its own origin, so relay 0 reaches each one over a peer session. Lite 06 (what the dash and peers negotiate today) and IETF 22. Throughput counts tracks, so flat elements/s means a constant cost per track.projects: 1 / 4 / 16 projects on 4 nodes (96 to 1536 tracks).tracks: 6 / 24 / 96 tracks per broadcast at 16 broadcasts.relays: 1 to 32 peer nodes carrying the same 768 tracks, then the production point (34 x 5 x 24 = 4080).Cluster::joinnow only connects, andViewer::watchsubscribes to a broadcast's tracks, so one viewer can follow many tracks per broadcast. The viewer's relay view includes hidden routes, like the dash's.stats/scope.Results
Measured on main with #4216, macOS M-series, one core for the whole mesh. The machine was shared (load 8-12), so treat these as +-30%.
Top costs (xctrace Time Profiler, lite, 384 vs 6144 tracks; the two profiles have the same shape):
Control::poll_serve, mostlypoll_recv_next->resume::Subscriber::poll_recv_group->poll_sync/refresh_anchor(17%) and theLiveEdgemax fold (5% self).SubscriberDriver(UniServeingest).kioWaiterList::register/wake, and 10% inpthread_mutexlock/unlock.kio::Tasks::pollswaps every bitset word on each owner poll. At 6144 in-flight groups that adds about 0.5 us per track, an O(n^2) term per tick. Skipping zero words with a relaxed load made no measurable difference, so I didn't file it.Finding
The model doesn't account for the production cost. The whole mesh, including every node, spends about 100 ms of one core per tick at the production shape. Production shows 50-90% of a core on the dash's relay alone, 5-9x more. That points at the relay layer or the transport (a QUIC stream per group, 4080 per second), not moq-net's model. I added this to the Relay session bench quest as its first shape. No new quests: no super-linear finding survived a rerun.
Impact
(Written by Claude Opus 5.5)
🤖 Generated with Claude Code