From 47287014a1412834ea8ad7e123ebf8dd2d6829bb Mon Sep 17 00:00:00 2001 From: Mathias Meyer Date: Wed, 5 Dec 2012 18:19:23 +0100 Subject: [PATCH] Use unicorn.rb config, sans prefork for now. --- config/unicorn.rb | 21 +-------------------- script/server | 2 +- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/config/unicorn.rb b/config/unicorn.rb index 2c751a22..45bae390 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -1,23 +1,4 @@ # http://michaelvanrooijen.com/articles/2011/06/01-more-concurrency-on-a-single-heroku-dyno-with-the-new-celadon-cedar-stack/ -worker_processes 3 # amount of unicorn workers to spin up +worker_processes 4 # amount of unicorn workers to spin up timeout 30 # restarts workers that hang for 15 seconds - -preload_app true - -before_fork do |server, worker| - ActiveRecord::Base.connection.disconnect! if defined?(ActiveRecord::Base) -end - -after_fork do |server, worker| - require 'travis' - - Travis::Amqp.connect - - ActiveRecord::Base.establish_connection if defined?(ActiveRecord::Base) - - if $metriks_reporter - $metriks_reporter.stop - $metriks_reporter.start - end -end diff --git a/script/server b/script/server index 29326751..cf218d5f 100755 --- a/script/server +++ b/script/server @@ -3,6 +3,6 @@ cd "$(dirname "$0")/.." [ $PORT ] || PORT=3000 [ $RACK_ENV ] || RACK_ENV=development -cmd="ruby -I lib -S bundle exec ruby -I lib -S unicorn config.ru -p $PORT -E $RACK_ENV" +cmd="ruby -I lib -S bundle exec ruby -I lib -S unicorn config.ru -c config/unicorn.rb -p $PORT -E $RACK_ENV" [[ $RACK_ENV == "development" ]] && exec rerun "$cmd -l 127.0.0.1:$PORT" exec $cmd