1 # This configuration file will be evaluated by Puma. The top-level methods that
2 # are invoked here are part of Puma's configuration DSL. For more information
3 # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
5 # Puma starts a configurable number of processes (workers) and each process
6 # serves each request in a thread from an internal thread pool.
8 # You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
9 # should only set this value when you want to run 2 or more workers. The
10 # default is already 1.
12 # The ideal number of threads per worker depends both on how much time the
13 # application spends waiting for IO operations and on how much you wish to
14 # prioritize throughput over latency.
16 # As a rule of thumb, increasing the number of threads will increase how much
17 # traffic a given process can handle (throughput), but due to CRuby's
18 # Global VM Lock (GVL) it has diminishing returns and will degrade the
19 # response time (latency) of the application.
21 # The default is set to 3 threads as it's deemed a decent compromise between
22 # throughput and latency for the average Rails application.
24 # Any libraries that use a connection pool or another resource pool should
25 # be configured to provide at least as many connections as the number of
26 # threads. This includes Active Record's `pool` parameter in `database.yml`.
27 threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
28 threads threads_count, threads_count
30 # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
31 port ENV.fetch("PORT", 3000)
33 # Allow puma to be restarted by `bin/rails restart` command.
36 # Run the Solid Queue supervisor inside of Puma for single-server deployments
37 plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
39 # Specify the PID file. Defaults to tmp/pids/server.pid in development.
40 # In other environments, only set the PID file if requested.
41 pidfile ENV["PIDFILE"] if ENV["PIDFILE"]