mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
added a minimal number of free slots that should always exist
This commit is contained in:
parent
2841434e36
commit
518ae2c608
1 changed files with 7 additions and 0 deletions
|
@ -7,6 +7,9 @@ module Middleware::UnicornOobgc
|
|||
|
||||
MIN_REQUESTS_PER_OOBGC = 3
|
||||
|
||||
# TUNE ME, for Discourse this number is good
|
||||
MIN_FREE_SLOTS = 80_000
|
||||
|
||||
def verbose(msg=nil)
|
||||
@verbose ||= ENV["OOBGC_VERBOSE"] == "1" ? :true : :false
|
||||
if @verbose == :true
|
||||
|
@ -66,6 +69,10 @@ module Middleware::UnicornOobgc
|
|||
@max_delta = [new_delta, delta].max
|
||||
end
|
||||
|
||||
if @max_delta < MIN_FREE_SLOTS
|
||||
@max_delta = MIN_FREE_SLOTS
|
||||
end
|
||||
|
||||
if @num_requests > MIN_REQUESTS_PER_OOBGC && @max_delta * 2 + new_live_num > @expect_gc_at
|
||||
t = Time.now
|
||||
GC.start
|
||||
|
|
Loading…
Reference in a new issue