Unverified Commit d77b0cf4 authored by Florian Klink's avatar Florian Klink Committed by GitHub
Browse files

Merge pull request #301064 from SuperSandro2000/redis-thp

nixos/redis: enable vmOverCommit by defaul; don't disable transparent hugepages
parents f515a0bd 5b88059f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -293,6 +293,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m

- `network-interfaces.target` system target was removed as it has been deprecated for a long time. Use `network.target` instead.

- `services.redis.vmOverCommit` now defaults to `true` and no longer enforces Transparent Hugepages (THP) to be disabled. Redis only works with THP configured to `madvise` which is the kernel's default.

- `azure-cli` now has extension support. For example, to install the `aks-preview` extension, use

  ```nix
+5 −6
Original line number Diff line number Diff line
@@ -57,9 +57,9 @@ in {
      package = mkPackageOption pkgs "redis" { };

      vmOverCommit = mkEnableOption ''
        setting of vm.overcommit_memory to 1
        set `vm.overcommit_memory` sysctl to 1
        (Suggested for Background Saving: <https://redis.io/docs/get-started/faq/>)
      '';
      '' // { default = true; };

      servers = mkOption {
        type = with types; attrsOf (submodule ({ config, name, ... }: {
@@ -312,10 +312,9 @@ in {
      '';
    }) enabledServers);

    boot.kernel.sysctl = mkMerge [
      { "vm.nr_hugepages" = "0"; }
      ( mkIf cfg.vmOverCommit { "vm.overcommit_memory" = "1"; } )
    ];
    boot.kernel.sysctl = mkIf cfg.vmOverCommit {
      "vm.overcommit_memory" = "1";
    };

    networking.firewall.allowedTCPPorts = concatMap (conf:
      optional conf.openFirewall conf.port