Created
June 2, 2015 10:17
-
-
Save tamadamas/97a397805fda5273262b to your computer and use it in GitHub Desktop.
Puma default config
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
workers ENV.fetch('WEB_CONCURRENCY') { 2 }.to_i | |
threads_count = ENV.fetch('MAX_THREADS') { 5 }.to_i | |
threads threads_count, threads_count | |
rackup DefaultRackup | |
port ENV.fetch('PORT') { 3000 } | |
environment ENV.fetch('RACK_ENV') { 'development' } | |
preload_app! | |
on_worker_boot do | |
# worker specific setup | |
ActiveRecord::Base.establish_connection | |
# If you are using Redis but not Resque, change this | |
if defined?(Resque) | |
Resque.redis = ENV["OPENREDIS_URL"] || "redis://127.0.0.1:6379" | |
Rails.logger.info('Connected to Redis') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment