Sha256: a9c38d27a1cc389d4510d0a57e084fdf77fc8b17c2dc0666d0c8fc23dcb1d98e

Contents?: true

Size: 898 Bytes

Versions: 5

Compression:

Stored size: 898 Bytes

Contents

# Change to match your CPU core count
workers Integer(ENV['WEB_CONCURRENCY'] || 4)

threads_count = Integer(ENV['MAX_THREADS'] || 5)
# Min and Max threads per worker
threads threads_count, threads_count

app_dir = File.expand_path("../..", __FILE__)

# Default to production
rails_env = ENV['RAILS_ENV'] || "production"
environment rails_env

# Set up socket location
bind "unix://#{app_dir}/tmp/sockets/puma.sock"

# Logging
stdout_redirect "#{app_dir}/log/puma.stdout.log", "#{app_dir}/log/puma.stderr.log", true

# Set master PID and state locations
pidfile "#{app_dir}/tmp/pids/puma.pid"
state_path "#{app_dir}/tmp/pids/puma.state"
activate_control_app

on_worker_boot do
  require "active_record"
  ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
  ActiveRecord::Base.establish_connection(YAML.load_file("#{app_dir}/config/database.yml")[rails_env])
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
subspace-0.3.0 ansible/roles/puma/templates/puma.rb
subspace-0.2.1 ansible/roles/puma/templates/puma.rb
subspace-0.1.3 ansible/roles/puma/templates/puma.rb
subspace-0.1.2 ansible/roles/puma/templates/puma.rb
subspace-0.1.1 ansible/roles/puma/templates/puma.rb