Skip to content

Commit

Permalink
[deploy] Enable Puma's nakayoshi_fork feature (#11121)
Browse files Browse the repository at this point in the history
* Run GC.compact before fork

* Change to nakayoshi_fork
  • Loading branch information
benhalpern committed Oct 28, 2020
1 parent ea156a2 commit 0847c38
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#
workers ENV.fetch("WEB_CONCURRENCY", 2)

# calls GC a handful of times and compacts the heap on Ruby 2.7+ before forking.
# This may reduce memory usage of Puma on MRI.
nakayoshi_fork

# 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 0847c38

Please sign in to comment.