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
This commit is contained in:
Sojan Jose
2022-05-06 16:38:44 +05:30
committed by GitHub
parent 77a6893203
commit 80b8f5f915

View File

@@ -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