A minimum channel capacity config (#549)

This commit is contained in:
Raja Subramanian
2022-03-22 13:13:48 +05:30
committed by GitHub
parent 825d3cdbea
commit 0a88dee95e
2 changed files with 25 additions and 6 deletions
+5 -4
View File
@@ -87,10 +87,11 @@ type PLIThrottleConfig struct {
} }
type CongestionControlConfig struct { type CongestionControlConfig struct {
Enabled bool `yaml:"enabled"` Enabled bool `yaml:"enabled"`
AllowPause bool `yaml:"allow_pause"` AllowPause bool `yaml:"allow_pause"`
UseSendSideBWE bool `yaml:"send_side_bandwidth_estimation,omitempty"` UseSendSideBWE bool `yaml:"send_side_bandwidth_estimation,omitempty"`
ProbeMode CongestionControlProbeMode `yaml:"padding_mode,omitempty"` ProbeMode CongestionControlProbeMode `yaml:"padding_mode,omitempty"`
MinChannelCapacity int64 `yaml:"min_channel_capacity,omitempty"`
} }
type InterfacesConfig struct { type InterfacesConfig struct {
+20 -2
View File
@@ -850,7 +850,16 @@ func (s *StreamAllocator) finalizeProbe() {
} }
func (s *StreamAllocator) maybeBoostDeficientTracks() { func (s *StreamAllocator) maybeBoostDeficientTracks() {
availableChannelCapacity := s.committedChannelCapacity - s.getExpectedBandwidthUsage() committedChannelCapacity := s.committedChannelCapacity
if s.params.Config.MinChannelCapacity > committedChannelCapacity {
committedChannelCapacity = s.params.Config.MinChannelCapacity
s.params.Logger.Debugw(
"overriding channel capacity",
"actual", s.committedChannelCapacity,
"override", committedChannelCapacity,
)
}
availableChannelCapacity := committedChannelCapacity - s.getExpectedBandwidthUsage()
if availableChannelCapacity <= 0 { if availableChannelCapacity <= 0 {
return return
} }
@@ -897,6 +906,14 @@ func (s *StreamAllocator) allocateAllTracks() {
update := NewStreamStateUpdate() update := NewStreamStateUpdate()
availableChannelCapacity := s.committedChannelCapacity availableChannelCapacity := s.committedChannelCapacity
if s.params.Config.MinChannelCapacity > availableChannelCapacity {
availableChannelCapacity = s.params.Config.MinChannelCapacity
s.params.Logger.Debugw(
"overriding channel capacity",
"actual", s.committedChannelCapacity,
"override", availableChannelCapacity,
)
}
// //
// This pass is find out if there is any leftover channel capacity after allocating exempt tracks. // This pass is find out if there is any leftover channel capacity after allocating exempt tracks.
@@ -1011,8 +1028,9 @@ func (s *StreamAllocator) initProbe(probeRateBps int64) {
s.probeChannelObserver = NewChannelObserver("probe", s.params.Logger, NumRequiredEstimatesProbe, NackRatioThresholdProbe) s.probeChannelObserver = NewChannelObserver("probe", s.params.Logger, NumRequiredEstimatesProbe, NackRatioThresholdProbe)
s.probeChannelObserver.SeedEstimate(s.lastReceivedEstimate) s.probeChannelObserver.SeedEstimate(s.lastReceivedEstimate)
desiredRateBps := int(probeRateBps) + int(math.Max(float64(s.committedChannelCapacity), float64(expectedBandwidthUsage)))
s.probeClusterId = s.prober.AddCluster( s.probeClusterId = s.prober.AddCluster(
int(s.committedChannelCapacity+probeRateBps), desiredRateBps,
int(expectedBandwidthUsage), int(expectedBandwidthUsage),
ProbeMinDuration, ProbeMinDuration,
ProbeMaxDuration, ProbeMaxDuration,