diff options
author | Florian Klink <flokli@flokli.de> | 2024-04-29 14:27:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-29 14:27:12 +0300 |
commit | d77b0cf4f106be4da129c4494d8fe10a66d8217a (patch) | |
tree | 11df3b544e845f615143993ba9a21520b1a61b82 /nixos/modules | |
parent | f515a0bd8955e5d0c461981f1b3167046fc44a20 (diff) | |
parent | 5b88059fe508c4606d0af7619f0face747a45435 (diff) |
Merge pull request #301064 from SuperSandro2000/redis-thp
nixos/redis: enable vmOverCommit by defaul; don't disable transparent hugepages
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/databases/redis.nix | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/nixos/modules/services/databases/redis.nix b/nixos/modules/services/databases/redis.nix index 1da2fa9f11604..ad88a4f589a20 100644 --- a/nixos/modules/services/databases/redis.nix +++ b/nixos/modules/services/databases/redis.nix @@ -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 |