質問編集履歴

1

puma.rbを追加しました。

2020/08/17 01:13

投稿

ganbarou_nippon
ganbarou_nippon

スコア18

test CHANGED
File without changes
test CHANGED
@@ -135,3 +135,83 @@
135
135
 
136
136
 
137
137
  よろしくお願い申し上げます。
138
+
139
+
140
+
141
+ 追加
142
+
143
+
144
+
145
+ ```ruby
146
+
147
+ #puma.rb
148
+
149
+ # Puma can serve each request in a thread from an internal thread pool.
150
+
151
+ # The `threads` method setting takes two numbers: a minimum and maximum.
152
+
153
+ # Any libraries that use thread pools should be configured to match
154
+
155
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
156
+
157
+ # and maximum; this matches the default thread size of Active Record.
158
+
159
+ #
160
+
161
+ threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
162
+
163
+ threads threads_count, threads_count
164
+
165
+
166
+
167
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
168
+
169
+ #
170
+
171
+ port ENV.fetch("PORT") { 3000 }
172
+
173
+
174
+
175
+ # Specifies the `environment` that Puma will run in.
176
+
177
+ #
178
+
179
+ environment ENV.fetch("RAILS_ENV") { "development" }
180
+
181
+
182
+
183
+ # Specifies the number of `workers` to boot in clustered mode.
184
+
185
+ # Workers are forked webserver processes. If using threads and workers together
186
+
187
+ # the concurrency of the application would be max `threads` * `workers`.
188
+
189
+ # Workers do not work on JRuby or Windows (both of which do not support
190
+
191
+ # processes).
192
+
193
+ #
194
+
195
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
196
+
197
+
198
+
199
+ # Use the `preload_app!` method when specifying a `workers` number.
200
+
201
+ # This directive tells Puma to first boot the application and load code
202
+
203
+ # before forking the application. This takes advantage of Copy On Write
204
+
205
+ # process behavior so workers use less memory.
206
+
207
+ #
208
+
209
+ # preload_app!
210
+
211
+
212
+
213
+ # Allow puma to be restarted by `rails restart` command.
214
+
215
+ plugin :tmp_restart
216
+
217
+ ```