annotate config/puma.rb @ 258:20eb1429af2e

Remove newrelic
author nanaya <me@nanaya.net>
date Sun, 15 Dec 2024 22:49:56 +0900
parents eda83610b65c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
1 # This configuration file will be evaluated by Puma. The top-level methods that
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
2 # are invoked here are part of Puma's configuration DSL. For more information
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
3 # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
255
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
4 #
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
5 # Puma starts a configurable number of processes (workers) and each process
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
6 # serves each request in a thread from an internal thread pool.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
7 #
255
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
8 # You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
9 # should only set this value when you want to run 2 or more workers. The
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
10 # default is already 1.
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
11 #
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
12 # The ideal number of threads per worker depends both on how much time the
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
13 # application spends waiting for IO operations and on how much you wish to
255
eda83610b65c Update rails and stuff
nanaya <me@nanaya.net>
parents: 254
diff changeset
14 # prioritize throughput over latency.
89
d5a0d66ee457 Finish updating to rails 5
nanaya <me@myconan.net>
parents:
diff changeset
15 #
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
16 # As a rule of thumb, increasing the number of threads will increase how much
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
17 # traffic a given process can handle (throughput), but due to CRuby's
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
18 # Global VM Lock (GVL) it has diminishing returns and will degrade the
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
19 # response time (latency) of the application.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
20 #
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
21 # The default is set to 3 threads as it's deemed a decent compromise between
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
22 # throughput and latency for the average Rails application.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
23 #
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
24 # Any libraries that use a connection pool or another resource pool should
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
25 # be configured to provide at least as many connections as the number of
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
26 # threads. This includes Active Record's `pool` parameter in `database.yml`.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
27 threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
89
d5a0d66ee457 Finish updating to rails 5
nanaya <me@myconan.net>
parents:
diff changeset
28 threads threads_count, threads_count
d5a0d66ee457 Finish updating to rails 5
nanaya <me@myconan.net>
parents:
diff changeset
29
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
30 # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
31 port ENV.fetch("PORT", 3000)
89
d5a0d66ee457 Finish updating to rails 5
nanaya <me@myconan.net>
parents:
diff changeset
32
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
33 # Allow puma to be restarted by `bin/rails restart` command.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
34 plugin :tmp_restart
89
d5a0d66ee457 Finish updating to rails 5
nanaya <me@myconan.net>
parents:
diff changeset
35
254
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
36 # Specify the PID file. Defaults to tmp/pids/server.pid in development.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
37 # In other environments, only set the PID file if requested.
89f6c0016bab Update to latest rails
nanaya <me@nanaya.net>
parents: 89
diff changeset
38 pidfile ENV["PIDFILE"] if ENV["PIDFILE"]