mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-18 06:59:43 +02:00
feat(hosts,lib): adjust kernel sysctl for k8s/dae
This commit is contained in:
@@ -23,6 +23,27 @@ in {
|
||||
boot.kernelModules = ["kvm-amd" "vfio-pci"];
|
||||
boot.extraModprobeConfig = "options kvm_amd nested=1"; # for amd cpu
|
||||
|
||||
boot.kernel.sysctl = {
|
||||
# --- filesystem --- #
|
||||
# increase the limits to avoid running out of inotify watches
|
||||
"fs.inotify.max_user_watches" = 524288;
|
||||
"fs.inotify.max_user_instances" = 1024;
|
||||
|
||||
# --- network --- #
|
||||
"net.bridge.bridge-nf-call-iptables" = 1;
|
||||
"net.core.somaxconn" = 32768;
|
||||
"net.ipv4.ip_forward" = 1;
|
||||
"net.ipv4.conf.all.forwarding" = 1;
|
||||
"net.ipv4.neigh.default.gc_thresh1" = 4096;
|
||||
"net.ipv4.neigh.default.gc_thresh2" = 6144;
|
||||
"net.ipv4.neigh.default.gc_thresh3" = 8192;
|
||||
"net.ipv4.neigh.default.gc_interval" = 60;
|
||||
"net.ipv4.neigh.default.gc_stale_time" = 120;
|
||||
|
||||
# --- memory --- #
|
||||
"vm.swappiness" = 0; # don't swap unless absolutely necessary
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Validate Hardware Virtualization Support via:
|
||||
# virt-host-validate qemu
|
||||
|
||||
Reference in New Issue
Block a user