Sha256: 9e1accd630eda380a34898f181b09fa79cec9f7bbda497813cb4e1f1b5ff25b2

Contents?: true

Size: 1.19 KB

Versions: 4

Compression:

Stored size: 1.19 KB

Contents

# Feel free to experiment with this, 0/16 is a good starting point.
threads ENV['THREADS_MIN'].to_i, ENV['THREADS_MAX'].to_i

# Go with at least 1 per CPU core, a higher amount will usually help for fast
# responses such as reading from a cache.
workers ENV['WORKERS'].to_i

# Listen on a tcp port or unix socket.
if ENV['LISTEN_ON'].include?(':')
  bind "tcp://#{ENV['LISTEN_ON']}"
else
  bind "unix:#{ENV['LISTEN_ON']}"
end

# The path where the pid file will be written to.
pidfile "#{ENV['RUN_STATE_PATH']}/#{ENV['SERVICE']}.pid"

# Use a shorter timeout instead of the 60s default. If you are handling large
# uploads you may want to increase this.
worker_timeout 30

# The file that gets logged to.
stdout_redirect ENV['LOG_FILE'], ENV['LOG_FILE']

# Preload the application before starting the workers.
preload_app!

# The path to the puma binary without any arguments, it will inherit everything
# from the original process.
restart_command 'bin/puma'

on_worker_boot do
  # Don't bother having the master process hang onto older connections.
  defined?(ActiveRecord::Base) and
    ActiveRecord::Base.connection.disconnect!

  defined?(ActiveRecord::Base) and
    ActiveRecord::Base.establish_connection
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
orats-0.9.7 lib/orats/templates/includes/new/rails/config/puma.rb
orats-0.9.6 lib/orats/templates/includes/new/rails/config/puma.rb
orats-0.9.5 lib/orats/templates/includes/new/rails/config/puma.rb
orats-0.9.4 lib/orats/templates/includes/new/rails/config/puma.rb