1 { pkgs, lib, config, ... }:
5 algorithm = lib.mkDefault "zstd";
6 memoryPercent = lib.mkDefault 50;
7 swapDevices = lib.mkDefault 1;
10 boot.kernel.sysctl = {
11 # Increase cache pressure, which increases the tendency of the kernel to
12 # reclaim memory used for caching of directory and inode objects. You will use
13 # less memory over a longer period of time. The performance hit is negated by
14 # the downside of swapping sooner.
15 "vm.vfs_cache_pressure" = lib.mkDefault 500;
17 # Increasing how aggressively the kernel will swap memory pages since we are
19 "vm.swappiness" = lib.mkDefault 100;
21 # Background processes will start writing right away when it hits the 1% limit
22 "vm.dirty_background_ratio" = lib.mkDefault 1;
24 # The system won’t force synchronous I/O until it gets to 50% dirty_ratio.
25 "vm.dirty_ratio" = lib.mkDefault 50;