mirror of
https://github.com/livekit/livekit.git
synced 2026-07-21 11:11:17 +00:00
add server agent load threshold config (#3520)
* remove agent worker load threshold * cleanup
This commit is contained in:
@@ -17,7 +17,6 @@ package service
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"slices"
|
||||
@@ -43,8 +42,6 @@ import (
|
||||
"github.com/livekit/psrpc"
|
||||
)
|
||||
|
||||
const agentWorkerLoadTarget = 0.65
|
||||
|
||||
type AgentSocketUpgrader struct {
|
||||
websocket.Upgrader
|
||||
}
|
||||
@@ -260,8 +257,6 @@ func (h *AgentHandler) registerWorker(w *agent.Worker) {
|
||||
typeTopic = h.participantTopic
|
||||
}
|
||||
|
||||
fmt.Println(">>> register worker", typeTopic)
|
||||
|
||||
err := h.agentServer.RegisterJobRequestTopic(nameTopic, typeTopic)
|
||||
if err != nil {
|
||||
h.mu.Unlock()
|
||||
@@ -431,7 +426,7 @@ func (h *AgentHandler) JobRequestAffinity(ctx context.Context, job *livekit.Job)
|
||||
}
|
||||
|
||||
if w.Status() == livekit.WorkerStatus_WS_AVAILABLE {
|
||||
affinity += max(0, agentWorkerLoadTarget-w.Load())
|
||||
affinity += max(0, 1-w.Load())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user