Skip to content

Commit

Permalink
Chore: Enable preload_app in Puma Config (TheOdinProject#1679)
Browse files Browse the repository at this point in the history
Because:
* The app will use less memory: https://github.com/puma/puma#clustered-mode
  • Loading branch information
KevinMulhern authored Jan 25, 2021
1 parent 6e2ed11 commit f54feb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
# 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') { 2 }

# 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

0 comments on commit f54feb7

Please sign in to comment.