web concurrency auto
This commit is contained in:
+8
-2
@@ -33,8 +33,14 @@ environment ENV.fetch('RAILS_ENV', 'development')
|
|||||||
# the concurrency of the application would be max `threads` * `workers`.
|
# the concurrency of the application would be max `threads` * `workers`.
|
||||||
# Workers do not work on JRuby or Windows (both of which do not support
|
# Workers do not work on JRuby or Windows (both of which do not support
|
||||||
# processes).
|
# processes).
|
||||||
#
|
|
||||||
workers ENV.fetch('WEB_CONCURRENCY', 0)
|
if ENV['WEB_CONCURRENCY_AUTO'] == 'true'
|
||||||
|
require 'etc'
|
||||||
|
|
||||||
|
workers Etc.nprocessors
|
||||||
|
else
|
||||||
|
workers ENV.fetch('WEB_CONCURRENCY', 0)
|
||||||
|
end
|
||||||
|
|
||||||
# Use the `preload_app!` method when specifying a `workers` number.
|
# Use the `preload_app!` method when specifying a `workers` number.
|
||||||
# This directive tells Puma to first boot the application and load code
|
# This directive tells Puma to first boot the application and load code
|
||||||
|
|||||||
Reference in New Issue
Block a user