mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
BUGFIX: incorrect OOBGC algorithm, not dynamically adjusting
This commit is contained in:
parent
bd7d1e62f6
commit
024b86e112
1 changed files with 2 additions and 2 deletions
|
@ -106,12 +106,12 @@ module Middleware::UnicornOobgc
|
||||||
@max_delta ||= delta
|
@max_delta ||= delta
|
||||||
|
|
||||||
if delta > @max_delta
|
if delta > @max_delta
|
||||||
new_delta = (delta * 1.5).to_i
|
new_delta = (@max_delta * 1.5).to_i
|
||||||
@max_delta = [new_delta, delta].min
|
@max_delta = [new_delta, delta].min
|
||||||
else
|
else
|
||||||
# this may seem like a very tiny decay rate, but some apps using caching
|
# this may seem like a very tiny decay rate, but some apps using caching
|
||||||
# can really mess stuff up, if our delta is too low the algorithm fails
|
# can really mess stuff up, if our delta is too low the algorithm fails
|
||||||
new_delta = (delta * 0.995).to_i
|
new_delta = (@max_delta * 0.99).to_i
|
||||||
@max_delta = [new_delta, delta].max
|
@max_delta = [new_delta, delta].max
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue