diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-21 00:21:50 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-21 00:21:50 +0200 |
| commit | f7d33c299ae0d0c4f406779b8f5324d80637adc8 (patch) | |
| tree | 92102776658fce04451cff90dd616cb4ee26030f /packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py | |
| parent | 375ad7d0435a176ad593a32045a5f0182a36d505 (diff) | |
| download | meshbay-f7d33c299ae0d0c4f406779b8f5324d80637adc8.tar.gz | |
perf(hub): bound video read-ahead by bytes, not by seconds
A browser limits bytes, so a bound in seconds had to be sized for the
highest-bitrate file and every ordinary one then held a fraction of what
the same buffer would have taken. Floored at the old 90 s so nothing
pulls less than before, and walked up rather than declared. A refused
append now waits for an eviction instead of retrying on every tick.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py')
| -rw-r--r-- | packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py b/packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py index e92ec13..a5e15df 100644 --- a/packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py +++ b/packages/meshbay-node/src/meshbay_node/transport/webrtc_server.py @@ -836,11 +836,19 @@ class WebRTCPeerSession: # misbehaving — it is the only view of the browser there is # when the browser is a phone. else: + # `ahead` on its own cannot say whether a short buffer is + # the player's own gate holding or the network failing to + # keep up, and those two want opposite answers. `limit` is + # what the gate is set to for this film and `budget` the + # byte budget it was derived from, so the three read as one + # sentence. log.debug( - "stream: client t=%ss ahead=%ss ready=%s paused=%s " + "stream: client t=%ss ahead=%ss/%ss budget=%sMB " + "ready=%s paused=%s " "stalled=%s q=%s inflight=%s appending=%s updating=%s " "quota=%s ms=%s err=%s ranges=[%s] (sent=%d)", - _f("t"), _f("ahead"), _f("ready"), _f("paused"), + _f("t"), _f("ahead"), _f("limit"), _f("budgetMB"), + _f("ready"), _f("paused"), _f("stalled"), _f("q"), _f("inflight"), _f("appending"), _f("updating"), _f("quota"), _f("ms"), _f("err", 80), _f("ranges", 120), self._stream_segments) |