B eagerly switches to another O if it has used that O before and thinks it will be faster even if the current O has a real-time latency score #2660
Labels
area: broadcasting
status: core contributors working on it
in progress
type: bug
Something isn't working
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Background
After B runs discovery in order to create a pool of Os for selection, the following rules apply for selection that are relevant for this issue:
[1]
go-livepeer/server/selection.go
Line 137 in a5045a2
[2]
go-livepeer/server/selection.go
Line 142 in a5045a2
[3]
go-livepeer/server/selection.go
Line 145 in a5045a2
Problem
Suppose the known session list for B is [O1.LatencyScore = 0.7. O2.LatencyScore = 0.8] and the following scenario:
This type of swapping behavior can be problematic because:
If the switch is to an O that was previously used, but no longer has an active transcoding session there will be overhead for initializing a new session which increases latency
Video players may not handle data coming in at very different rates i.e. the last segment came in in Xs, this segment came in in Ys where X and Y are quite different
There are likely going to be diminishing returns once you're faster than real-time i.e. if writing transcoded data (so that it can be delivered) is slower than transcoding speed
Describe the solution you'd like
A clear and concise description of what you want to happen.
B should stick with the last O that it used for transcoding a stream as long as it met the acceptable threshold.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
The use of a last known latency score for each session also contributes to this problem because if an O is slightly slower than real-time for a single segment then a swap to another O could be triggered which may not be ideal because:
A better scoring mechanism for the session would incorporate latency scores over time - something like a moving average or a EWMA. This type of latency score formulation would dampen the impact of a single slightly slower than real-time segment on selection which can help stabilize selection for streams. I suspect this would be a bigger change though and I think it can be tackled separately/in parallel to this issue in #1232.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: