Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#This file is used by Rack-based servers to start the application.
if defined?(Unicorn)
require 'unicorn/oob_gc'
require 'unicorn/worker_killer'
# Prevent garbage collection from running during requests
GC.disable
# Run garbage collection out-of-band every n requests
use(Unicorn::OobGC, 10)
# Minimum and maximum number of requests for a worker
use(Unicorn::WorkerKiller::MaxRequests, 3000, 5000)
# Minimum, maximum, and check frequency for worker memory allocation
use(Unicorn::WorkerKiller::Oom, (712*(1024**2)), (1024**3), 16)
end
# Load rails environment and start the application
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment