production unicorn changes

This commit is contained in:
r888888888
2016-11-07 03:24:34 -08:00
parent 898f3b105d
commit 619beb00af
3 changed files with 22 additions and 6 deletions

View File

@@ -2,9 +2,18 @@
require ::File.expand_path('../config/environment', __FILE__)
# if defined?(Unicorn) && Rails.env.production?
# require_dependency 'gctools/oobgc'
# use GC::OOB::UnicornMiddleware
# end
if defined?(Unicorn) && Rails.env.production?
# Unicorn self-process killer
require 'unicorn/worker_killer'
# Max requests per worker
use Unicorn::WorkerKiller::MaxRequests, 10_000, 15_000
# Max memory size (RSS) per worker
#use Unicorn::WorkerKiller::Oom, (192*(1024**2)), (256*(1024**2))
require 'gctools/oobgc'
use GC::OOB::UnicornMiddleware
end
run Rails.application