|
23 | 23 | threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
|
24 | 24 | threads threads_count, threads_count
|
25 | 25 |
|
26 | | -# Specifies the `environment` that Puma will run in. |
27 | | -rails_env = ENV.fetch("RAILS_ENV", "development") |
28 | | -environment rails_env |
29 | | - |
30 | | -case rails_env |
31 | | -when "production" |
32 | | - # If you are running more than 1 thread per process, the workers count |
33 | | - # should be equal to the number of processors (CPU cores) in production. |
34 | | - # |
35 | | - # Automatically detect the number of available processors in production. |
36 | | - require "concurrent-ruby" |
37 | | - workers_count = Integer(ENV.fetch("WEB_CONCURRENCY") { Concurrent.available_processor_count }) |
38 | | - workers workers_count if workers_count > 1 |
39 | | - |
40 | | - preload_app! |
41 | | -when "development" |
42 | | - # Specifies a very generous `worker_timeout` so that the worker |
43 | | - # isn't killed by Puma when suspended by a debugger. |
44 | | - worker_timeout 3600 |
45 | | -end |
46 | | - |
47 | 26 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
48 | 27 | port ENV.fetch("PORT", 3000)
|
49 | 28 |
|
|
0 commit comments