feat(nix): add kernel and memory tuning for amd system
Tune sysctl parameters for better I/O and memory performance: - Lower swappiness to reduce disk swapping with zram - Reduce vfs_cache_pressure to keep filesystem caches longer - Adjust dirty page writeback ratios for SSD performance - Configure zram with zstd compression Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
a28cd7948c
commit
ea849f2488
1 changed files with 20 additions and 2 deletions
|
|
@ -65,9 +65,22 @@ with lib.metacfg;
|
|||
"electron-27.3.11"
|
||||
];
|
||||
|
||||
# increase freezing timeout
|
||||
# Kernel tuning
|
||||
boot.kernel.sysctl = {
|
||||
"power.pm_freeze_timeout" = 30000;
|
||||
# Reduce swap usage (you have zram)
|
||||
"vm.swappiness" = 10;
|
||||
# Prefer keeping directory/inode caches
|
||||
"vm.vfs_cache_pressure" = 50;
|
||||
# Faster dirty page writeback
|
||||
"vm.dirty_ratio" = 10;
|
||||
"vm.dirty_background_ratio" = 5;
|
||||
};
|
||||
|
||||
# SSD TRIM support
|
||||
services.fstrim = {
|
||||
enable = true;
|
||||
interval = "weekly";
|
||||
};
|
||||
|
||||
programs.steam = {
|
||||
|
|
@ -96,7 +109,12 @@ with lib.metacfg;
|
|||
cider-2
|
||||
];
|
||||
|
||||
zramSwap.enable = true;
|
||||
# zram swap with zstd compression for better performance
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
algorithm = "zstd";
|
||||
memoryPercent = 50;
|
||||
};
|
||||
|
||||
services.ratbagd.enable = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue