1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Add some docs and modify warning message re: single worker warning. [ci skip]

This commit is contained in:
Nate Berkopec 2021-03-09 07:43:07 -07:00
parent 81d26e91b7
commit 714ce75a1c
No known key found for this signature in database
GPG key ID: 19616755F4328D71
2 changed files with 12 additions and 1 deletions

View file

@ -477,7 +477,7 @@ module Puma
log "! WARNING: Detected running cluster mode with 1 worker."
log "! Running Puma in cluster mode with a single worker is often a misconfiguration."
log "! Consider running Puma in single-mode in order to reduce memory overhead."
log "! Consider running Puma in single-mode (workers = 0) in order to reduce memory overhead."
log "! Set the `silence_single_worker_warning` option to silence this warning message."
end

View file

@ -484,6 +484,17 @@ module Puma
# Disable warning message when running in cluster mode with a single worker.
#
# Cluster mode has some overhead of running an addtional 'control' process
# in order to manage the cluster. If only running a single worker it is
# likely not worth paying that overhead vs running in single mode with
# additional threads instead.
#
# There are some scenarios where running cluster mode with a single worker
# may still be warranted and valid under certain deployment scenarios, see
# https://github.com/puma/puma/issues/2534
#
# Moving from workers = 1 to workers = 0 will save 10-30% of memory use.
#
# @note Cluster mode only.
def silence_single_worker_warning
@options[:silence_single_worker_warning] = true