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 @@ -48,7 +48,7 @@ end
gem 'mysql2'

# Webserver - included in development and test and optionally in production
gem 'puma'
gem 'puma', '>= 6.4.3'

gem 'bootsnap', require: false
gem 'csv'
Expand Down
10 changes: 10 additions & 0 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
#
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }

workers ENV.fetch("WEB_CONCURRENCY", 2)
threads_count = ENV.fetch("RAILS_MAX_THREADS", 5)
threads threads_count, threads_count
preload_app!
port ENV.fetch("PORT", 3000)
environment ENV.fetch("RAILS_ENV", "development")

# SECURITY FIX: Raise on SIGTERM to prevent request queue poisoning
raise_exception_on_sigterm

# 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
Expand Down