moq-relay: --stats-enabled breaks --cache-capacity when subscribers rejoin often — memory grows without limit
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- performance
Hướng nghiên cứu
Start with TrackState::pay_debt in track.rs and trace how stats-enabled session tagging affects cache_accessed() for groups when a subscriber rejoins. Compare eviction behavior with stats enabled and disabled, using the reproduction settings in the issue. Done means the cache respects --cache-capacity during repeated rejoins with stats enabled, without changing the reported stats behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bottom line: With --stats-enabled, the relay stops evicting cached groups once subscribers rejoin a live track every few seconds. Memory then grows at the track's full ingest rate and never stops. Without --stats-enabled, the cache cap works. Seen on 0.17.10 and 0.17.18.
How to reproduce
- One publisher, one live track at about 1.9 Mbit/s.
- One subscriber that replaces its session every 6 seconds: open a new session, subscribe, then close the old one.
- Run the relay with
--cache-capacity 16MiB --stats-enabled. - Watch the relay's memory for 15 minutes.
What happens (relay memory, 0.17.10)
| Setup | Growth |
|---|---|
| 16MiB cap, stats off | none, flat at about 32 MiB |
| 16MiB cap, stats on | +10 MiB/min, 162 MiB after 15 min |
| 128MiB cap, stats on | +10 MiB/min, 409 MiB after 40 min |
| 0.17.18, 16MiB cap, stats on | +10 MiB/min |
| Stats on, one subscriber that never rejoins | none |
| Stats on, rejoin every 90 s | about +0.08 MiB/min |
The growth equals the ingest rate, so every group is being kept.
What we found
- Memory profile: all the growth is frame data from the publisher's writes.
- In
TrackState::pay_debt(track.rs), with stats on, most groups are skipped as "recently used" (cache_accessed() > average), so the cache never gets back under its cap. In one run, 456 groups were skipped and 45 evicted. With stats off, 0 were skipped and 94 evicted. - It isn't the
.statspublisher or the byte counters. Turning off just the stats session tagging (Handle::sessionreturningSession::default) stops the growth. Turning off everything else doesn't.
What we don't know: which part of the session tagging keeps those groups looking recently used.
- Ngôn ngữ chính
- Rust
- Star
- 1.6k
- Fork
- 251
- Merge trung bình
- 10 giờ 10 phút
- Pull request đã merge (30 ngày)
- 832
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của moq-dev/moq
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Bump the quest flake input past kixel-ai/quest#1202 (Codex reviews use the config's gateway)Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Mobile release verification reports missing build inputs with a custom Cargo target directoryĐang mởbug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
getsotto/sotto-authenticator#139 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
registrystack/registry-stack#2924 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
foundry-rs/starknet-foundry#4733 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100