Skip to content

Instantly share code, notes, and snippets.

Created June 18, 2014 15:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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
# 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)
# 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