Use unicorn.rb config, sans prefork for now.
This commit is contained in:
parent
37e04c16ae
commit
47287014a1
|
@ -1,23 +1,4 @@
|
||||||
# http://michaelvanrooijen.com/articles/2011/06/01-more-concurrency-on-a-single-heroku-dyno-with-the-new-celadon-cedar-stack/
|
# 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
|
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
|
|
||||||
|
|
|
@ -3,6 +3,6 @@ cd "$(dirname "$0")/.."
|
||||||
[ $PORT ] || PORT=3000
|
[ $PORT ] || PORT=3000
|
||||||
[ $RACK_ENV ] || RACK_ENV=development
|
[ $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"
|
[[ $RACK_ENV == "development" ]] && exec rerun "$cmd -l 127.0.0.1:$PORT"
|
||||||
exec $cmd
|
exec $cmd
|
||||||
|
|
Loading…
Reference in New Issue
Block a user