diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix index db62d6f90901..6619949f5540 100644 --- a/nixos/modules/services/misc/gitlab.nix +++ b/nixos/modules/services/misc/gitlab.nix @@ -901,6 +901,16 @@ in { ''; }; + sidekiq.concurrency = mkOption { + type = with types; nullOr int; + default = null; + description = lib.mdDoc '' + How many processor threads to use for processing sidekiq background job queues. When null, the GitLab default is used. + + See for details. + ''; + }; + sidekiq.memoryKiller.enable = mkOption { type = types.bool; default = true; @@ -1454,12 +1464,17 @@ in { TimeoutSec = "infinity"; Restart = "always"; WorkingDirectory = "${cfg.packages.gitlab}/share/gitlab"; - ExecStart = utils.escapeSystemdExecArgs [ - "${cfg.packages.gitlab}/share/gitlab/bin/sidekiq-cluster" - "-e" "production" - "-r" "." - "*" # all queue groups - ]; + ExecStart = utils.escapeSystemdExecArgs ( + [ + "${cfg.packages.gitlab}/share/gitlab/bin/sidekiq-cluster" + "*" # all queue groups + ] ++ lib.optionals (cfg.sidekiq.concurrency != null) [ + "--concurrency" (toString cfg.sidekiq.concurrency) + ] ++ [ + "--environment" "production" + "--require" "." + ] + ); }; };