NASA666

不以物喜,不以己悲.
Posted on , viewed 620 times

puma.rb

# puma.rb
port 3000
workers (`nproc`.strip.to_i)
threads 8, 16
preload_app!

on_worker_boot do
  ActiveSupport.on_load(:active_record) do
    ActiveRecord::Base.establish_connection
  end
end

before_fork do
  ActiveRecord::Base.connection_pool.disconnect!
end
### puma.rb end