nixos/redis: Disable hugepages for redis via sysctl and not via a systemd-oneshot
This commit is contained in:
parent
2695914175
commit
fe143bac5b
1 changed files with 3 additions and 11 deletions
|
@ -186,9 +186,9 @@ in
|
|||
|
||||
config = mkIf config.services.redis.enable {
|
||||
|
||||
boot.kernel.sysctl = mkIf cfg.vmOverCommit {
|
||||
"vm.overcommit_memory" = "1";
|
||||
};
|
||||
boot.kernel.sysctl = {
|
||||
"vm.nr_hugepages" = "0";
|
||||
} // mkIf cfg.vmOverCommit { "vm.overcommit_memory" = "1"; };
|
||||
|
||||
networking.firewall = mkIf cfg.openFirewall {
|
||||
allowedTCPPorts = [ cfg.port ];
|
||||
|
@ -198,14 +198,6 @@ in
|
|||
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
systemd.services.disable-transparent-huge-pages = {
|
||||
description = "Disable Transparent Huge Pages (required by Redis)";
|
||||
before = [ "redis.service" ];
|
||||
wantedBy = [ "redis.service" ];
|
||||
script = "echo never > /sys/kernel/mm/transparent_hugepage/enabled";
|
||||
serviceConfig.Type = "oneshot";
|
||||
};
|
||||
|
||||
systemd.services.redis =
|
||||
{ description = "Redis Server";
|
||||
|
||||
|
|
Loading…
Reference in a new issue