practice doing this
at main 2.1 kB view raw
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. 4# 5# Puma starts a configurable number of processes (workers) and each process 6# serves each request in a thread from an internal thread pool. 7# 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. You can set it to `auto` to automatically start a worker 11# for each available processor. 12# 13# The ideal number of threads per worker depends both on how much time the 14# application spends waiting for IO operations and on how much you wish to 15# prioritize throughput over latency. 16# 17# As a rule of thumb, increasing the number of threads will increase how much 18# traffic a given process can handle (throughput), but due to CRuby's 19# Global VM Lock (GVL) it has diminishing returns and will degrade the 20# response time (latency) of the application. 21# 22# The default is set to 3 threads as it's deemed a decent compromise between 23# throughput and latency for the average Rails application. 24# 25# Any libraries that use a connection pool or another resource pool should 26# be configured to provide at least as many connections as the number of 27# threads. This includes Active Record's `pool` parameter in `database.yml`. 28threads_count = ENV.fetch("RAILS_MAX_THREADS", 3) 29threads threads_count, threads_count 30 31# Specifies the `port` that Puma will listen on to receive requests; default is 3000. 32port ENV.fetch("PORT", 3000) 33 34# Allow puma to be restarted by `bin/rails restart` command. 35plugin :tmp_restart 36 37# Run the Solid Queue supervisor inside of Puma for single-server deployments. 38plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] 39 40# Specify the PID file. Defaults to tmp/pids/server.pid in development. 41# In other environments, only set the PID file if requested. 42pidfile ENV["PIDFILE"] if ENV["PIDFILE"]