[deploy] Enable Puma's nakayoshi_fork feature (#11121)

* Run GC.compact before fork

* Change to nakayoshi_fork
This commit is contained in:
Ben Halpern 2020-10-28 09:22:44 -04:00 committed by GitHub
parent ea156a201d
commit 0847c38196
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,6 +26,10 @@ pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
#
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