Sha256: de972787c36de3a339067abea712db6d7643465ededaf06c879a14acb88754f4

Contents?: true

Size: 974 Bytes

Versions: 3

Compression:

Stored size: 974 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 0, threads_count

app_dir = "/u/apps/{{project_name}}/current"
directory app_dir

rails_env = "{{rails_env}}"
environment rails_env

# Set up socket location
bind "tcp://127.0.0.1:9292"

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

# Set master PID and state locations
daemonize
pidfile "/u/apps/{{project_name}}/shared/tmp/pids/puma.pid"
state_path "/u/apps/{{project_name}}/shared/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

# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
subspace-0.4.2 ansible/roles/puma/templates/puma.rb
subspace-0.4.1 ansible/roles/puma/templates/puma.rb
subspace-0.4.0 ansible/roles/puma/templates/puma.rb