From 8d1bb8c411d8dc363b1bc8e707cdfe0fc148732e Mon Sep 17 00:00:00 2001 From: Christoph Cullmann Date: Wed, 23 Apr 2025 18:49:02 +0200 Subject: [PATCH] tune the ZFS pool for NVMe --- share/common.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/share/common.nix b/share/common.nix index af94371..81171ff 100644 --- a/share/common.nix +++ b/share/common.nix @@ -134,6 +134,18 @@ in options zfs zfs_vdev_def_queue_depth=128 ''; + # tune the ZFS pool for NVMe + system.activationScripts.zfsTuning = { + text = '' + # only one level of metadata caching + ${pkgs.zfs}/bin/zfs set primarycache=metadata zpool + ${pkgs.zfs}/bin/zfs set secondarycache=none zpool + + # use always direct IO to avoid ARC overhead + ${pkgs.zfs}/bin/zfs set direct=always zpool + ''; + }; + # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true;