1.117.2 - "scale puma worker count to processor count" causes OOM on multi-core servers with limited RAM
-
Hi,
the 1.117.2 update introduced scaling Puma workers to the processor count. On my server with 12 cores this changed the worker count from the previous default of 3 to 12 — a 4x increase in RAM consumption, causing repeated OOM kills.
Setup:
- Cloudron 9.2.0
- GitLab 1.117.2
- 12 CPU cores, 24GB RAM total
- Small team, ~5 active users
What happened:
Before 1.117.2, GitLab ran stably for years with 7GB RAM limit (3 Puma workers by default viapuma.rb). After the update, GitLab immediately started hitting OOM repeatedly — even after raising the memory limit to 14GB, it still consumed 13.99GB and got killed.The root cause is in
start.sh:cpus=$(nproc 2>/dev/null || echo 2) export PUMA_WORKERS=$(( cpus < 2 ? 2 : cpus ))On a 12-core server this sets 12 Puma workers. Each worker consumes ~800MB–1GB RAM, so Puma alone needs ~12GB — before Gitaly, Sidekiq and Redis are counted.
Suggestion:
Either capPUMA_WORKERSat a reasonable maximum (e.g. 4–6), or provide a way to override it via/app/data/so admins can tune it for their setup.Is there a recommended workaround in the meantime?
Thanks
-
Thanks for the hint
The GitLab docs describe configuring Puma via/etc/gitlab/gitlab.rb, but the Cloudron package doesn't use Omnibus — it has its own Docker-based setup withgitlab.ymland astart.shscript.In
start.sh, the worker count is set like this:cpus=$(nproc 2>/dev/null || echo 2) export PUMA_WORKERS=$(( cpus < 2 ? 2 : cpus ))Since
start.shis read-only inside the container, I can't overridePUMA_WORKERSdirectly. Is there a supported way in the Cloudron GitLab package to override this — for example via a file in/app/data/or a similar mechanism? -
I also checked
start.shfor any hook mechanism (sourcing a custom file from/app/data/etc.), there is none. So there is currently no supported way for end users to overridePUMA_WORKERSwithout modifying read-only container files.A fix would need to come from the package itself, for example by capping the worker count or by reading an override from
/app/data/like:PUMA_WORKERS=$(( cpus < 2 ? 2 : cpus )) [[ -f /app/data/puma_workers ]] && PUMA_WORKERS=$(cat /app/data/puma_workers) export PUMA_WORKERSUntil then, the only workaround is raising the memory limit in Cloudron significantly. On a 12-core server this means ~14-18GB just for GitLab!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login