move unicorn killer to initializer so thin still works, also a fix for newrelic not sending data
This commit is contained in:
parent
8aafd56482
commit
335172c411
2 changed files with 8 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2010-2011, Diaspora Inc. This file is
|
# Copyright (c) 2010-2011, Diaspora Inc. This file is
|
||||||
# licensed under the Affero General Public License version 3 or later. See
|
# licensed under the Affero General Public License version 3 or later. See
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
|
|
@ -8,8 +8,6 @@ require ::File.expand_path('../config/environment', __FILE__)
|
||||||
require ::File.expand_path('../lib/unicorn_killer', __FILE__)
|
require ::File.expand_path('../lib/unicorn_killer', __FILE__)
|
||||||
require ::File.expand_path('../lib/rack/chrome_frame', __FILE__)
|
require ::File.expand_path('../lib/rack/chrome_frame', __FILE__)
|
||||||
|
|
||||||
# use UnicornKiller::MaxRequests, 1000
|
|
||||||
use UnicornKiller::Oom, 400 * 1024 #kill a unicorn that has gone over 400mB
|
|
||||||
|
|
||||||
use Rack::ChromeFrame, :minimum => 8
|
use Rack::ChromeFrame, :minimum => 8
|
||||||
run Diaspora::Application
|
run Diaspora::Application
|
||||||
|
|
|
||||||
7
config/initializers/unicorn_setup.rb
Normal file
7
config/initializers/unicorn_setup.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Copyright (c) 2010-2011, Diaspora Inc. This file is
|
||||||
|
# licensed under the Affero General Public License version 3 or later. See
|
||||||
|
# the COPYRIGHT file.
|
||||||
|
if defined? Unicorn
|
||||||
|
Rails.application.middleware.insert(0, UnicornKiller::Oom, 400 * 1024) #kill a unicorn that has gone over 400mB
|
||||||
|
NewRelic::Agent.after_fork(:force_reconnect => true) if defined?(NewRelic)
|
||||||
|
end
|
||||||
Loading…
Reference in a new issue