moq-net: a joining session costs ~34 ms of relay CPU, mostly announce discovery and driver polling
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- backend, performance
Línea de trabajo
Start by locating the named announce and session driver paths, including AnnouncePrefix, AnnounceRun, Discovery, OriginState::snapshot, and lite::session::Driver::poll_protocol; the issue provides no file paths or reproduction command. Profile joins with and without announcements, then trace why discovery and polling run before the first subscription settles. Done means announce discovery is independent of origin contents when unused, or deferred until requested, and the excess driver polling is explained.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
A session joining a relay costs about 34 ms of host CPU, independent of how many sessions are already connected, and most of it is not the QUIC or TLS handshake. At 16.7 joins/s that is 0.57 of a 2-vCPU relay's cores, so the connection count at which the relay's CPU-based shed trips depends on the arrival rate more than on fan-out.
Measurement
- Relay:
moq-relayfrom moq62c0ec81, frame-pointer release build, on a 2-vCPU dedicated AMD EPYC 7713 VM (kernel 6.18). - Load:
moq-bench --fanout chat --fps 1 --frame-size 200from two generators, each with one 1:N channel, ramping linearly at 8.3 connections/s each (16.7/s total). - Steady: 45 s of
perf record -F 99 --call-graph fp -aat a constant 3,000 connections and no joins. Host 0.764 cores, relay process 0.648, idle host 0.038, so steady state costs 0.242 host cores per 1,000 connections at 1 msg/s. - Ramp: 140 s capture while the ramp went from 915 to 3,077 connections (mean about 2,000). Host 1.096 cores, process 0.984. The steady model gives 0.52 host cores at 2,000 connections, which leaves 0.575 host cores for 16.7 joins/s: about 34 ms per join. Slicing the ramp capture into 10 s bins puts that excess roughly constant from 900 to 3,100 connections.
Ramp minus steady (scaled to the ramp's mean connection count), relay-process cores, each sample assigned to the first category whose frames it contains:
| Category (matching frames) | Ramp | Steady | Excess |
|---|---|---|---|
announce/origin discovery (AnnouncePrefix, AnnounceRun, Discovery, OriginState::snapshot, origin_impl::TableCursor::awaits, Prefixes::overlaps/covering, Snapshot drop) |
0.146 | 0.004 | 0.141 |
session accept/setup (server::Handshake, start_lite, accept path) |
0.018 | 0.003 | 0.015 |
subscribe request outside TrackRun (SubscribeServe, TrackInfoServe) |
0.087 | 0.017 | 0.070 |
subscriber side (SubscriberDriver: UniAccept, end_datagrams) |
0.100 | 0.032 | 0.068 |
TrackRun/GroupServe |
0.228 | 0.183 | 0.045 |
QUIC driver, crypto, sendmsg |
0.149 | 0.107 | 0.041 |
other: mostly lite::session::Driver::poll_protocol and session::Supervisor::poll |
0.257 | 0.084 | 0.173 |
Path parsing shows up inside the announce category: CharSearcher::next_match and path::parts::Parts::next take 3.7% and 4.9% of all ramp samples. The viewers announce nothing and subscribe to one named broadcast, so each join is paying to build and drop an origin snapshot and to match prefixes it never uses.
Ask
- Make a new session's announce discovery cost independent of what the origin holds when the client has not asked for announcements, or defer it until it does.
- Find out why a newly started session's driver polls so much more than a steady one (the 0.17-core "other" row) before its first subscription settles.
Caveats: perf's sample counts on this VM read 1.4-1.6x the kernel's process ticks, so absolute cores above come from /proc ticks and the samples only provide shares. The steady model is linear from one point (3,000 connections).
(Written by Claude Opus 5.5 with medium)
- Lenguaje dominante
- Rust
- Estrellas
- 1.6k
- Forks
- 251
- Merge medio
- 10 h 10 min
- PR fusionados (30 d)
- 832
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de moq-dev/moq
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
Bump the quest flake input past kixel-ai/quest#1202 (Codex reviews use the config's gateway)Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
Todos los issues de moq-dev/moq
Issues similares
-
Mobile release verification reports missing build inputs with a custom Cargo target directoryAbiertobug good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
getsotto/sotto-authenticator#139 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
registrystack/registry-stack#2924 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
foundry-rs/starknet-foundry#4733 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100