puma.rb 321 B

1234567891011
  1. if ENV.fetch('WEB_CONCURRENCY') == 'auto'
  2. before_fork do
  3. Sequel::DATABASES.each(&:disconnect)
  4. end
  5. else
  6. workers ENV.fetch('WEB_CONCURRENCY')
  7. require 'concurrent/utility/processor_counter'
  8. threads = (::Concurrent.available_processor_count * 1.5).to_i
  9. threads threads
  10. ENV['MAX_THREADS'] = threads.to_s
  11. end