From ba1a32850e178fa14783683642c8a7553c9a032c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Denquin?= Date: Mon, 20 May 2024 11:59:45 +0200 Subject: [PATCH] chore(puma): Tweak puma configuration (#2037) - Tweak puma configuration to improve performances --- config/puma.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/puma.rb b/config/puma.rb index b34266c521b..9d800fea3e3 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -7,13 +7,14 @@ # and maximum; this matches the default thread size of Active Record. # max_threads_count = ENV.fetch('RAILS_MAX_THREADS', 5) -min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count } +min_threads_count = ENV.fetch('RAILS_MIN_THREADS', 0) threads min_threads_count, max_threads_count # Specifies the `worker_timeout` threshold that Puma will use to wait before # terminating a worker in development environments. # worker_timeout 3600 if ENV.fetch('RAILS_ENV', 'development') == 'development' +worker_timeout 12 if ENV.fetch('RAILS_ENV', 'production') == 'production' # Specifies the `port` that Puma will listen on to receive requests; default is 3000. # @@ -39,7 +40,7 @@ # before forking the application. This takes advantage of Copy On Write # process behavior so workers use less memory. # -# preload_app! +preload_app! if ENV['WEB_CONCURRENCY'].present? # Allow puma to be restarted by `bin/rails restart` command. plugin :tmp_restart