production unicorn changes
This commit is contained in:
4
Gemfile
4
Gemfile
@@ -69,8 +69,8 @@ end
|
|||||||
|
|
||||||
group :production do
|
group :production do
|
||||||
gem 'newrelic_rpm'
|
gem 'newrelic_rpm'
|
||||||
# gem 'unicorn-worker-killer'
|
gem 'unicorn-worker-killer'
|
||||||
# gem 'gctools', :platforms => :ruby
|
gem 'gctools', :platforms => :ruby
|
||||||
end
|
end
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
|
|||||||
@@ -138,6 +138,8 @@ GEM
|
|||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
ffaker (2.1.0)
|
ffaker (2.1.0)
|
||||||
ffi (1.9.10-x64-mingw32)
|
ffi (1.9.10-x64-mingw32)
|
||||||
|
gctools (0.2.4)
|
||||||
|
get_process_mem (0.2.1)
|
||||||
git (1.3.0)
|
git (1.3.0)
|
||||||
github_api (0.14.5)
|
github_api (0.14.5)
|
||||||
addressable (~> 2.4.0)
|
addressable (~> 2.4.0)
|
||||||
@@ -401,6 +403,9 @@ GEM
|
|||||||
kgio (~> 2.6)
|
kgio (~> 2.6)
|
||||||
rack
|
rack
|
||||||
raindrops (~> 0.7)
|
raindrops (~> 0.7)
|
||||||
|
unicorn-worker-killer (0.4.4)
|
||||||
|
get_process_mem (~> 0)
|
||||||
|
unicorn (>= 4, < 6)
|
||||||
vcr (2.9.3)
|
vcr (2.9.3)
|
||||||
webmock (1.21.0)
|
webmock (1.21.0)
|
||||||
addressable (>= 2.3.6)
|
addressable (>= 2.3.6)
|
||||||
@@ -435,6 +440,7 @@ DEPENDENCIES
|
|||||||
dtext_rb!
|
dtext_rb!
|
||||||
factory_girl
|
factory_girl
|
||||||
ffaker
|
ffaker
|
||||||
|
gctools
|
||||||
google-api-client
|
google-api-client
|
||||||
highline
|
highline
|
||||||
kgio
|
kgio
|
||||||
@@ -472,6 +478,7 @@ DEPENDENCIES
|
|||||||
tzinfo-data
|
tzinfo-data
|
||||||
uglifier
|
uglifier
|
||||||
unicorn
|
unicorn
|
||||||
|
unicorn-worker-killer
|
||||||
vcr
|
vcr
|
||||||
webmock
|
webmock
|
||||||
whenever
|
whenever
|
||||||
|
|||||||
17
config.ru
17
config.ru
@@ -2,9 +2,18 @@
|
|||||||
|
|
||||||
require ::File.expand_path('../config/environment', __FILE__)
|
require ::File.expand_path('../config/environment', __FILE__)
|
||||||
|
|
||||||
# if defined?(Unicorn) && Rails.env.production?
|
if defined?(Unicorn) && Rails.env.production?
|
||||||
# require_dependency 'gctools/oobgc'
|
# Unicorn self-process killer
|
||||||
# use GC::OOB::UnicornMiddleware
|
require 'unicorn/worker_killer'
|
||||||
# end
|
|
||||||
|
# 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
|
run Rails.application
|
||||||
|
|||||||
Reference in New Issue
Block a user