Created
May 13, 2019 07:13
-
-
Save 3014zhangshuo/e56fe8eb4df5496b4e897e8d65dc25c8 to your computer and use it in GitHub Desktop.
puma 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
bundle exec puma start -C config/puma.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
threads_count = 32 | |
threads 4, 32 | |
port 8888 | |
environment "production" | |
app_dir = '/opt/app/www.yoursite.com/current' | |
directory app_dir | |
rackup "#{app_dir}/config.ru" | |
shared_dir = '/opt/app/www.yoursite.com/shared' | |
workers 8 | |
bind "unix://#{shared_dir}/sockets/puma.sock" | |
stdout_redirect "#{shared_dir}/log/puma.stdout.log", "#{shared_dir}/log/puma.stderr.log", true | |
pidfile "#{shared_dir}/pids/puma.pid" | |
state_path "#{shared_dir}/pids/puma.state" | |
daemonize true | |
preload_app! | |
before_fork do | |
ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord) | |
end | |
on_worker_boot do | |
ActiveRecord::Base.establish_connection if defined?(ActiveRecord) | |
end | |
# Allow puma to be restarted by `rails restart` command. | |
plugin :tmp_restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment