Merge pull request #301064 from SuperSandro2000/redis-thp

nixos/redis: enable vmOverCommit by defaul; don't disable transparent hugepages

authored by Florian Klink and committed by GitHub d77b0cf4 f515a0bd

+7 -6
+2
nixos/doc/manual/release-notes/rl-2405.section.md
··· 293 294 - `network-interfaces.target` system target was removed as it has been deprecated for a long time. Use `network.target` instead. 295 296 - `azure-cli` now has extension support. For example, to install the `aks-preview` extension, use 297 298 ```nix
··· 293 294 - `network-interfaces.target` system target was removed as it has been deprecated for a long time. Use `network.target` instead. 295 296 + - `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. 297 + 298 - `azure-cli` now has extension support. For example, to install the `aks-preview` extension, use 299 300 ```nix
+5 -6
nixos/modules/services/databases/redis.nix
··· 57 package = mkPackageOption pkgs "redis" { }; 58 59 vmOverCommit = mkEnableOption '' 60 - setting of vm.overcommit_memory to 1 61 (Suggested for Background Saving: <https://redis.io/docs/get-started/faq/>) 62 - ''; 63 64 servers = mkOption { 65 type = with types; attrsOf (submodule ({ config, name, ... }: { ··· 312 ''; 313 }) enabledServers); 314 315 - boot.kernel.sysctl = mkMerge [ 316 - { "vm.nr_hugepages" = "0"; } 317 - ( mkIf cfg.vmOverCommit { "vm.overcommit_memory" = "1"; } ) 318 - ]; 319 320 networking.firewall.allowedTCPPorts = concatMap (conf: 321 optional conf.openFirewall conf.port
··· 57 package = mkPackageOption pkgs "redis" { }; 58 59 vmOverCommit = mkEnableOption '' 60 + set `vm.overcommit_memory` sysctl to 1 61 (Suggested for Background Saving: <https://redis.io/docs/get-started/faq/>) 62 + '' // { default = true; }; 63 64 servers = mkOption { 65 type = with types; attrsOf (submodule ({ config, name, ... }: { ··· 312 ''; 313 }) enabledServers); 314 315 + boot.kernel.sysctl = mkIf cfg.vmOverCommit { 316 + "vm.overcommit_memory" = "1"; 317 + }; 318 319 networking.firewall.allowedTCPPorts = concatMap (conf: 320 optional conf.openFirewall conf.port