Repository navigation
perf(net): serve whole cached groups from a parked track's copy - #6286
Conversation
Quest-Claim: 20c77cbdb3ecb133
Co-Authored-By: GPT-6 <noreply@openai.com>
|
Checkpoint pushed: the 64-viewer lite-05/06/07 regression proves one upstream FETCH per group and one TRACK total. Three paired CPU rounds isolate demand lifecycle overhead: at one publisher/64 viewers, normal FETCH costs 34.5 us/viewer versus 19.9 for the held-query diagnostic control. No production optimization or API/wire change is retained; the quest remains open and this PR remains draft with the ownership decision under Decisions needed. Verification: all 36 benchmark smoke cases, 471 quest documents, lints, and capture/playback (511) plus CLI playback (220) tests pass. The default suite passes 7,956/7,957; its sole failure is the base stats readiness issue fixed separately in #6290. (Written by GPT-6) |
…4d23c593d92 # Conflicts: # rs/moq-net/benches/session.rs
A relay revived its parked logical track for every viewer's FETCH, even when the parked copy already cached the whole group. A finished group needs no route kept up, so serve it straight from that copy without waking the front. Open, headless, aborted, and failed-copy groups still take the route. A source detaching drops the shortcut. Drop the held-query bench control and retire the FETCH fan-out quest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review (Written by Claude Opus 5.5) |
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 reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
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 |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Problem
When many viewers FETCH the same group through a relay over moq-lite, the relay already sends one upstream FETCH per group. Each viewer's FETCH still revived the relay's parked logical track, though: the front saw demand, queried the source copy, spliced it, and parked it again once the group was read. The copy's cache already held the whole group, so all of that work was accidental.
Approach
track::Consumer::fetch_groupserves a group straight from that parked copy when the copy holds it whole: finished, starting at frame 0, on a copy that is neither closed nor aborted. The logical track is never revived, so the front never wakes. Nothing more feeds a whole group, so no route has to stay up while it is read.Fetchingas a direct cache hit.session_delivery_fetch_demandgroup are dropped. The normal/fetchsweep now amortizes. The control's remaining advantage is per-viewer client work that no ownership-preserving change can remove (see below). With the control gone, the group's normal half duplicatessession_delivery_group_cost's/fetchcases.Measurements
These are callgrind instruction counts, because the shared host was too loaded for stable Criterion timings (load average around 30 on 24 cores). Each cell is the instructions per viewer FETCH for
moq-lite-06, one relay, and the default 1 MiB window. I ran each case for 1 s and for 4 s under--profile-timeand divided the instruction difference by the difference in fetches, so setup cancels out. "Before" is this branch's merge ofmainwithout the change. The held-query control is the dropped diagnostic, measured on the same base.From 1 to 64 viewers, per-viewer cost now falls 37% with one publisher, against 23% before. At 16 publishers and 16 viewers each viewer watches its own broadcast, so no group is shared and nothing changes. Single-viewer rows are within noise.
The rest of the gap to the control is the viewers' own work. A viewer's fetch of a group it lacks is a miss on its own copy. That miss revives the viewer's logical track so the open group keeps its route and can fail over mid-read, and the viewer's copy releases its route's demand once idle. That cost is per viewer, so it cannot shrink as viewers grow. A viewer that holds a query avoids it, which is all the control did.
Impact
moq-relay, through the lite and IETF publishers'fetch_group).Decisions
Settled while iterating. The recommended option was taken for each one, since this ran unattended:
/fetchsweep amortizes. Record what remains in the epic.Validation
cargo nextest run -p moq-netafter merging the latestmain: 3034 passed, 11 skipped.just check: the Rust and quest modules pass. The flake module fails only in the runner-image build, because this host cannot create a user namespace (unshare: write failed /proc/self/uid_map: Operation not permitted). That failure predates this branch.quest check --base origin/main --branch quest/m1/release-perf/fetch-fanoutpasses, with 598 documents.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code