mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
fix(concurrency): clamp learned limit below the ceiling
An overload seen with many requests in flight set the learned limit above the ceiling. The learner now clamps the value to one below the ceiling.
This commit is contained in:
@@ -95,6 +95,9 @@ func (c *concurrencyLearner) observe(provider string, resp *http.Response, err e
|
||||
if next < 1 {
|
||||
next = 1
|
||||
}
|
||||
if next > learnedCeiling-1 {
|
||||
next = learnedCeiling - 1
|
||||
}
|
||||
if s.learned == 0 || next < s.learned {
|
||||
s.learned = next
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user