Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ gem 'open-uri'
gem 'paper_trail'
gem 'pg', '~> 1.1'
gem 'postmark-rails'
gem 'puma', '~> 6'
gem 'puma', '~> 7.2'
gem 'rack-cors'
gem 'rails', '~> 7.1'
gem 'scout_apm'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ GEM
date
stringio
public_suffix (6.0.2)
puma (6.6.1)
puma (7.2.0)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.8.1)
Expand Down Expand Up @@ -618,7 +618,7 @@ DEPENDENCIES
pg (~> 1.1)
postmark-rails
pry-byebug
puma (~> 6)
puma (~> 7.2)
rack-cors
rails (~> 7.1)
rails-erd
Expand Down
31 changes: 18 additions & 13 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,25 @@
# Specifies the `pidfile` that Puma will use.
pidfile ENV.fetch('PIDFILE', 'tmp/pids/server.pid')

# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked web server processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
worker_count = ENV.fetch('WEB_CONCURRENCY', 1).to_i

# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory.
#
# preload_app!
if worker_count > 1

# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked web server processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).

workers worker_count

# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory.

preload_app!
end

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