From 1b3d44bd769bd11c70c075146d396d859e4e0518 Mon Sep 17 00:00:00 2001 From: magic_rb Date: Sat, 21 Oct 2023 15:00:20 +0200 Subject: [PATCH] Limit Hydra evaluator memory usage and collect garbage Signed-off-by: magic_rb --- nixng/containers/hydra/hydra.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nixng/containers/hydra/hydra.nix b/nixng/containers/hydra/hydra.nix index ecc3edb..9821815 100644 --- a/nixng/containers/hydra/hydra.nix +++ b/nixng/containers/hydra/hydra.nix @@ -46,6 +46,7 @@ makeSystem { minimumDiskFreeEvaluator = 100; dbiFile = "/local/dbi"; + config.evaluator_max_memory_size = "2048M"; }; services.socklog = { enable = true; @@ -66,6 +67,19 @@ makeSystem { enabled = true; }; + services.crond.crontabs.autogc = { + jobs = + let + storegc = pkgs.writeShellScript "storegc" + '' + nix-collect-garbage -d + ''; + in + [ + "0 4 * * * ${storegc}" + ]; + }; + init.services.nix-daemon.environment.PATH = with pkgs; lib.makeBinPath [ utillinux runit