mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
apf: calculation of dR/dt should use seats in use
This commit is contained in:
parent
513ae557a3
commit
6203d4fc6a
@ -414,9 +414,9 @@ func (qs *queueSet) syncTimeLocked() {
|
||||
// been advancing, according to the logic in `doc.go`.
|
||||
func (qs *queueSet) getVirtualTimeRatioLocked() float64 {
|
||||
activeQueues := 0
|
||||
reqs := 0
|
||||
seatsInUse := 0
|
||||
for _, queue := range qs.queues {
|
||||
reqs += queue.requestsExecuting
|
||||
seatsInUse += queue.seatsInUse
|
||||
if queue.requests.Length() > 0 || queue.requestsExecuting > 0 {
|
||||
activeQueues++
|
||||
}
|
||||
@ -424,7 +424,7 @@ func (qs *queueSet) getVirtualTimeRatioLocked() float64 {
|
||||
if activeQueues == 0 {
|
||||
return 0
|
||||
}
|
||||
return math.Min(float64(reqs), float64(qs.dCfg.ConcurrencyLimit)) / float64(activeQueues)
|
||||
return math.Min(float64(seatsInUse), float64(qs.dCfg.ConcurrencyLimit)) / float64(activeQueues)
|
||||
}
|
||||
|
||||
// timeoutOldRequestsAndRejectOrEnqueueLocked encapsulates the logic required
|
||||
|
Loading…
Reference in New Issue
Block a user