Open
Conversation
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).
Contributor
There was a problem hiding this comment.
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 |
mwtrew
approved these changes
Feb 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.