mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
added a minimal number of free slots that should always exist
This commit is contained in:
parent
2841434e36
commit
518ae2c608
@ -7,6 +7,9 @@ module Middleware::UnicornOobgc
|
|||||||
|
|
||||||
MIN_REQUESTS_PER_OOBGC = 3
|
MIN_REQUESTS_PER_OOBGC = 3
|
||||||
|
|
||||||
|
# TUNE ME, for Discourse this number is good
|
||||||
|
MIN_FREE_SLOTS = 80_000
|
||||||
|
|
||||||
def verbose(msg=nil)
|
def verbose(msg=nil)
|
||||||
@verbose ||= ENV["OOBGC_VERBOSE"] == "1" ? :true : :false
|
@verbose ||= ENV["OOBGC_VERBOSE"] == "1" ? :true : :false
|
||||||
if @verbose == :true
|
if @verbose == :true
|
||||||
@ -66,6 +69,10 @@ module Middleware::UnicornOobgc
|
|||||||
@max_delta = [new_delta, delta].max
|
@max_delta = [new_delta, delta].max
|
||||||
end
|
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
|
if @num_requests > MIN_REQUESTS_PER_OOBGC && @max_delta * 2 + new_live_num > @expect_gc_at
|
||||||
t = Time.now
|
t = Time.now
|
||||||
GC.start
|
GC.start
|
||||||
|
Loading…
Reference in New Issue
Block a user