From 3ea210e884dc031f7620cea2bf8e88c80f109a8f Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 28 Mar 2021 23:25:14 +0000 Subject: [PATCH] marukuru: tweak GitLab Puma settings for low-mem Per the GitLab docs (https://docs.gitlab.com/ee/install/requirements.html#puma-settings): > If the operating system has a maximum 2 GB of memory, the recommended number > of threads is 1. A higher value will result in excess swapping, and decrease > performance. and > In a memory-constrained environment with less than 4GB of RAM available, > consider disabling Puma Clustered mode. > > Configuring Puma by setting the amount of workers to 0 could reduce memory > usage by hundreds of MB. For details on Puma worker and thread settings, see > Puma settings. --- ops/nixos/marukuru/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ops/nixos/marukuru/default.nix b/ops/nixos/marukuru/default.nix index 816ea02c57..1a1ee28402 100644 --- a/ops/nixos/marukuru/default.nix +++ b/ops/nixos/marukuru/default.nix @@ -148,6 +148,10 @@ in { gitlab_rails['gitlab_email_reply_to'] = 'noreply@hg.lukegb.com' prometheus['enable'] = false + + puma['min_threads'] = 1 + puma['max_threads'] = 1 + puma['worker_processes'] = 0 ''; }; };