File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
railties/lib/rails/generators/rails/app/templates/config Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
11
11
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
12
12
threads min_threads_count, max_threads_count
13
13
14
+ # Specifies that the worker count should equal the number of processors in production.
15
+ if ENV["RAILS_ENV"] == "production"
16
+ worker_count = ENV.fetch("WEB_CONCURRENCY") { Concurrent.physical_processor_count }
17
+ workers worker_count if worker_count > 1
18
+ end
19
+
14
20
# Specifies the `worker_timeout` threshold that Puma will use to wait before
15
21
# terminating a worker in development environments.
16
22
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
You can’t perform that action at this time.
0 commit comments