From 72ab0b54e82ef4521ed1623cb306445bff8025f8 Mon Sep 17 00:00:00 2001 From: John Paul Ashenfelter Date: Mon, 23 Feb 2026 16:11:44 -0500 Subject: [PATCH] Add web_concurrency option --- config/puma.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/puma.rb b/config/puma.rb index 579706c96..837ab39df 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -31,6 +31,12 @@ # Specifies the `port` that Puma will listen on to receive requests; default is 3000. port ENV.fetch("PORT", 3000) +# Use multiple workers (forked processes) to handle requests in parallel. +# Each worker gets its own thread pool, enabling use of multiple CPU cores. +workers ENV.fetch("WEB_CONCURRENCY", 1).to_i + +preload_app! + # Allow puma to be restarted by `bin/rails restart` command. plugin :tmp_restart