Last active
August 29, 2015 13:56
-
-
Save joenoon/8848141 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if defined?(PhusionPassenger) | |
# Rails.logger is not available at the time of adding the middleware | |
class PassengerRailsLoggerProxy | |
def info(*args) | |
if @logger ||= Rails.logger | |
@logger.info(*args) | |
end | |
end | |
end | |
PhusionPassenger.require_passenger_lib 'rack/out_of_band_gc' | |
# Trigger out-of-band GC every N requests. | |
config.middleware.use PhusionPassenger::Rack::OutOfBandGc, (ENV['OOB_GC_FREQ'] || 5).to_i, PassengerRailsLoggerProxy.new | |
GC.disable | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment