diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-27 22:52:50 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-27 22:52:50 +0200 |
| commit | 9a19a0494ef51cdac9a78e24d517ca48ba44c453 (patch) | |
| tree | 8eaae12d8047a40e29d3ea7ff3116b5c869e04bd /config/puma.rb | |
| parent | 85a01e35274b8d4d4165a7b26bd7986e211246bb (diff) | |
| parent | 1853082fcd8c067390c246f9daa01a9b47387497 (diff) | |
Migration from Rails 2.3.5 to Rails 8.1 successful.
Merging dev branch.
Diffstat (limited to 'config/puma.rb')
| -rw-r--r-- | config/puma.rb | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 0000000..38c4b86 --- /dev/null +++ b/config/puma.rb | |||
| @@ -0,0 +1,42 @@ | |||
| 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`. | ||
| 28 | threads_count = ENV.fetch("RAILS_MAX_THREADS", 3) | ||
| 29 | threads threads_count, threads_count | ||
| 30 | |||
| 31 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. | ||
| 32 | port ENV.fetch("PORT", 3000) | ||
| 33 | |||
| 34 | # Allow puma to be restarted by `bin/rails restart` command. | ||
| 35 | plugin :tmp_restart | ||
| 36 | |||
| 37 | # Run the Solid Queue supervisor inside of Puma for single-server deployments. | ||
| 38 | plugin :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. | ||
| 42 | pidfile ENV["PIDFILE"] if ENV["PIDFILE"] | ||
