1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Update puma config.

This commit is contained in:
Dan Barber 2014-12-16 08:29:52 +00:00
parent 4ef40d5611
commit 89d3af759a
2 changed files with 19 additions and 1 deletions

View File

@ -1 +1 @@
web: bundle exec puma -p $PORT -e $RACK_ENV -t 0:5
web: bundle exec puma -C config/puma.rb

18
config/puma.rb Normal file
View File

@ -0,0 +1,18 @@
workers Integer(ENV['PUMA_WORKERS'] || 3)
threads Integer(ENV['MIN_THREADS'] || 1), Integer(ENV['MAX_THREADS'] || 16)
preload_app!
rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'
on_worker_boot do
# worker specific setup
ActiveSupport.on_load(:active_record) do
config = ActiveRecord::Base.configurations[Rails.env] ||
Rails.application.config.database_configuration[Rails.env]
config['pool'] = ENV['MAX_THREADS'] || 16
ActiveRecord::Base.establish_connection(config)
end
end