From 80b8f5f915528bac7df92ca6aa7fe56d5e54f73c Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Fri, 6 May 2022 16:38:44 +0530 Subject: [PATCH] chore: Update puma config as per recommendations (#3640) Ability to configure workers for puma ref: https://devcenter.heroku.com/articles/concurrency-and-database-connections#threaded-servers https://www.speedshop.co/2017/10/12/appserver.html --- config/puma.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/puma.rb b/config/puma.rb index 1df88f6db..49cc02d5a 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -25,14 +25,14 @@ pidfile ENV.fetch('PIDFILE') { 'tmp/pids/server.pid' } # Workers do not work on JRuby or Windows (both of which do not support # processes). # -# workers ENV.fetch("WEB_CONCURRENCY") { 2 } +workers ENV.fetch('WEB_CONCURRENCY', 1) # 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! +preload_app! # Allow puma to be restarted by `rails restart` command. plugin :tmp_restart