|
4 | 4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum |
5 | 5 | # and maximum; this matches the default thread size of Active Record. |
6 | 6 | # |
7 | | -max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } |
8 | | -min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } |
| 7 | +max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 } |
| 8 | +min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count } |
9 | 9 | threads min_threads_count, max_threads_count |
10 | 10 |
|
11 | 11 | # Specifies the `worker_timeout` threshold that Puma will use to wait before |
12 | 12 | # terminating a worker in development environments. |
13 | 13 | # |
14 | | -worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" |
| 14 | +worker_timeout 3600 if ENV.fetch('RAILS_ENV', 'development') == 'development' |
15 | 15 |
|
16 | 16 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. |
17 | 17 | # |
18 | | -port ENV.fetch("PORT") { 3000 } |
| 18 | +port ENV.fetch('PORT') { 3000 } |
19 | 19 |
|
20 | 20 | # Specifies the `environment` that Puma will run in. |
21 | 21 | # |
22 | | -environment ENV.fetch("RAILS_ENV") { "development" } |
| 22 | +environment ENV.fetch('RAILS_ENV') { 'development' } |
23 | 23 |
|
24 | 24 | # Specifies the `pidfile` that Puma will use. |
25 | | -pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } |
| 25 | +pidfile ENV.fetch('PIDFILE') { 'tmp/pids/server.pid' } |
26 | 26 |
|
27 | 27 | # Specifies the number of `workers` to boot in clustered mode. |
28 | 28 | # Workers are forked web server processes. If using threads and workers together |
29 | 29 | # the concurrency of the application would be max `threads` * `workers`. |
30 | 30 | # Workers do not work on JRuby or Windows (both of which do not support |
31 | 31 | # processes). |
32 | 32 | # |
33 | | -# workers ENV.fetch("WEB_CONCURRENCY") { 2 } |
| 33 | +workers ENV.fetch('WEB_CONCURRENCY') { 4 } |
34 | 34 |
|
35 | 35 | # Use the `preload_app!` method when specifying a `workers` number. |
36 | 36 | # This directive tells Puma to first boot the application and load code |
37 | 37 | # before forking the application. This takes advantage of Copy On Write |
38 | 38 | # process behavior so workers use less memory. |
39 | 39 | # |
40 | | -# preload_app! |
| 40 | +preload_app! |
41 | 41 |
|
42 | 42 | # Allow puma to be restarted by `bin/rails restart` command. |
43 | 43 | plugin :tmp_restart |
0 commit comments