Skip to content

Comments

Allow us to configure web concurrency#682

Open
zetter-rpf wants to merge 2 commits intomainfrom
increase-puma-workers
Open

Allow us to configure web concurrency#682
zetter-rpf wants to merge 2 commits intomainfrom
increase-puma-workers

Conversation

@zetter-rpf
Copy link
Contributor

@zetter-rpf zetter-rpf commented Feb 16, 2026

Part of https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/1133

We're currently running with a single process (puma web worker) which may mean a single long running request can block our server and cause other requests to fail.

Now we have upgraded to a performance dyno, we have enough RAM to run web workers (Heroku recommends using 2). I've make this configurable (starting with 1) so that it's easier to change (which we would need to do if we are RAM constrained).

I have also upgraded Puma to the latest version.

After deploy

Change WEB_CONCURRENCY to 2 in terraform.

I've checked the changelog and can't see any changes that affect us
Part of RaspberryPiFoundation/digital-editor-issues#1133

We're currently running with a single process (puma web worker) which may mean a single long running request can block our server and cause other requests to fail.

Now we have upgraded to a performance dyno, we have enough RAM to run web workers (Heroku recommends using 2). I've make this configurable (starting with 1) so that it's easier to change (which we would need to do if we are RAM constrained).
@cla-bot cla-bot bot added the cla-signed label Feb 16, 2026
@zetter-rpf zetter-rpf changed the title Increase puma workers Allow us to configure web concurrency Feb 16, 2026
@zetter-rpf zetter-rpf marked this pull request as ready for review February 16, 2026 09:25
Copilot AI review requested due to automatic review settings February 16, 2026 09:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables configurable web concurrency for the Puma web server to improve request handling capacity and prevent blocking. The change upgrades Puma from version 6 to version 7.2 and introduces the WEB_CONCURRENCY environment variable to control the number of worker processes. The default remains at 1 worker to maintain current behavior, with plans to increase to 2 workers post-deployment via Terraform configuration.

Changes:

  • Added configurable worker count via WEB_CONCURRENCY environment variable (defaults to 1)
  • Enabled clustered mode with preload_app! when worker_count > 1
  • Upgraded Puma gem from ~> 6 to ~> 7.2

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
config/puma.rb Implements conditional worker configuration based on WEB_CONCURRENCY environment variable and enables preload_app! for clustered mode
Gemfile Updates Puma version constraint from ~> 6 to ~> 7.2
Gemfile.lock Reflects Puma upgrade from 6.6.1 to 7.2.0

@zetter-rpf zetter-rpf enabled auto-merge (rebase) February 17, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants