Skip to content

Commit

Permalink
server: Look for as many orchs as possible for untrusted pool
Browse files Browse the repository at this point in the history
  • Loading branch information
yondonfu committed Oct 21, 2021
1 parent c6721f9 commit 1a35579
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ func NewSessionPool(mid core.ManifestID, poolSize, numOrchs int, sus *suspender,
}

func (sp *SessionPool) suspend(orch string) {
sp.sus.suspend(orch, sp.poolSize/sp.numOrchs)
poolSize := math.Max(1, float64(sp.poolSize))
numOrchs := math.Max(1, float64(sp.numOrchs))
penalty := int(math.Ceil(poolSize / numOrchs))
sp.sus.suspend(orch, penalty)
}

func (sp *SessionPool) refreshSessions() {
Expand Down Expand Up @@ -355,7 +358,7 @@ func NewSessionManager(node *core.LivepeerNode, params *core.StreamParameters, s
}
maxInflight := common.HTTPTimeout.Seconds() / SegLen.Seconds()
trustedNumOrchs := int(math.Min(trustedPoolSize, maxInflight*2))
untrustedNumOrchs := int(math.Min(untrustedPoolSize, maxInflight*2)) * 2
untrustedNumOrchs := int(untrustedPoolSize)
susTrusted := newSuspender()
susUntrusted := newSuspender()
createSessionsTrusted := func() ([]*BroadcastSession, error) {
Expand Down

0 comments on commit 1a35579

Please sign in to comment.