Skip to content

Commit

Permalink
DEV-517: Puma tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
danschmidt5189 committed Mar 18, 2024
1 parent b823dd6 commit 2cf867e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
threads_count = ENV.fetch('PUMA_THREADS', 5).to_i
threads threads_count, threads_count
min_threads = ENV.fetch('MIN_THREADS', 1).to_i
max_threads = ENV.fetch('RAILS_MAX_THREADS', 5).to_i
threads min_threads, max_threads

# Specifies the `worker_timeout` threshold that Puma will use to wait before
# terminating a worker in development environments.
Expand All @@ -27,6 +28,10 @@
# processes).
workers ENV.fetch('PUMA_WORKERS', 2).to_i

# Tells puma to try to route requests to workers having less load.
# This is on by default in Puma v6.0+.
wait_for_less_busy_worker

# 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

0 comments on commit 2cf867e

Please sign in to comment.