Commit dcd0f499 authored by Yaya's avatar Yaya Committed by Yureka
Browse files

nixos/gitlab: Add option sidekiq.concurrency.

This commit adds an option to configure the amount of threads to use
with sidekiq-cluster. The GitLab default is currently set to 20 threads. In
space constrained environments this may become a problem with running
out of memory as a result.
parent c5550f4f
Loading
Loading
Loading
Loading
+21 −6
Original line number Diff line number Diff line
@@ -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 <https://docs.gitlab.com/ee/administration/sidekiq/extra_sidekiq_processes.html#manage-thread-counts-explicitly> 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 [
        ExecStart = utils.escapeSystemdExecArgs (
          [
            "${cfg.packages.gitlab}/share/gitlab/bin/sidekiq-cluster"
          "-e" "production"
          "-r" "."
            "*" # all queue groups
        ];
          ] ++ lib.optionals (cfg.sidekiq.concurrency != null) [
            "--concurrency" (toString cfg.sidekiq.concurrency)
          ] ++ [
            "--environment" "production"
            "--require" "."
          ]
        );
      };
    };