Created
May 12, 2012 21:29
-
-
Save nordringrayhide/2669196 to your computer and use it in GitHub Desktop.
Rails foreman gem configs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: bundle --binstubs && bin/foreman start | |
gem 'unicorn', '~> 4.3.1' | |
group :development do | |
gem 'foreman', '~> 0.46.0' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
timeout 15 # 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 'my_app' | |
ActiveRecord::Base.establish_connection if defined?(ActiveRecord::Base) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment