Skip to content

Commit

Permalink
hosts: adjust cpu weight and quota
Browse files Browse the repository at this point in the history
  • Loading branch information
linyinfeng committed Sep 21, 2023
1 parent 2780437 commit 8d32ba8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
7 changes: 5 additions & 2 deletions nixos/hosts/framework/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,11 @@ in {

# limit cpu quota for nix-daemon for laptop
{
# 16 cores in total
systemd.services.nix-daemon.serviceConfig.CPUQuota = "800%";
systemd.services.nix-daemon.serviceConfig = {
# 16 cores in total
CPUQuota = "800%";
CPUWeight = "idle";
};
}
];
}
7 changes: 7 additions & 0 deletions nixos/hosts/fsn0/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
suites.server
++ (with profiles; [
programs.tg-send
programs.ccache
services.nginx
services.acme
services.notify-failure
Expand Down Expand Up @@ -143,5 +144,11 @@
restartUnits = ["systemd-networkd.service"];
};
})

# hydra build server
{
# limit cpu usage of nix builds
systemd.services.nix-daemon.serviceConfig.CPUWeight = "idle";
}
];
}
6 changes: 4 additions & 2 deletions nixos/hosts/hil0/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ in {
suites.server
++ (with profiles; [
programs.tg-send
programs.ccache
services.nginx
services.acme
services.notify-failure
Expand Down Expand Up @@ -128,8 +129,9 @@ in {
services.hydra.buildMachinesFiles = [
"/etc/nix-build-machines/hydra-builder/machines"
];
# limit cpu quota of nix builds
systemd.services.nix-daemon.serviceConfig.CPUQuota = "300%";
# limit cpu usage of nix eval and builds
systemd.services.nix-daemon.serviceConfig.CPUWeight = "idle";
systemd.services.hydra-evaluator.serviceConfig.CPUWeight = "idle";
}
];
}
2 changes: 2 additions & 0 deletions nixos/hosts/xps8930/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ in {

services.xserver.desktopManager.gnome.enable = true;

systemd.services.nix-daemon.serviceConfig.CPUWeight = "idle";

virtualisation.kvmgt = {
enable = true;
device = "0000:00:02.0";
Expand Down

0 comments on commit 8d32ba8

Please sign in to comment.