diff --git a/hosts/skydick/DATAPOOL.md b/hosts/skydick/DATAPOOL.md index 50d919c..530e6bb 100644 --- a/hosts/skydick/DATAPOOL.md +++ b/hosts/skydick/DATAPOOL.md @@ -21,6 +21,7 @@ - `dick/users//{files,bt-state,vm}` for per-user private data - `dick/system/{backup,vm}` for centrally managed system storage - `dick/templates/vm` for shared read-only VM base images +- `dick` should carry `atime=off`, so child datasets inherit a read-optimized default unless explicitly overridden The old `dick/{share,backup,torrent,vm}` layout is no longer part of the design. Torrent payload now lives under `/srv/media/data`, and organized media under `/srv/media/library`. @@ -183,6 +184,11 @@ 10.0.1.1:/users/ldx /mnt/skydick nfs4 rw,hard,rsize=1048576,wsize=1048576,nconnect=16,_netdev 0 0 ``` +For SMB on `skydick`, keep Samba on its Linux defaults for socket buffers and SMB multichannel +unless a benchmark proves a specific override helps. The host-side low-risk storage tuning is +`atime=off` on the `dick` pool root so reads do not create extra metadata writes across child +datasets. + ## Share details ### Public (`/srv/public`) @@ -369,6 +375,13 @@ done ``` +`dick` is expected to have `atime=off`; the child datasets above inherit it automatically. Verify +after creation: + +```bash +zfs get atime dick dick/users/ dick/users//files +``` + ### 6. Bootstrap SMB login if the user needs SMB ```bash @@ -456,6 +469,12 @@ zfs list -o name,used,avail,refer,quota -r dick ``` +Check the datapool access-time policy: + +```bash +zfs get -r atime dick +``` + Check NFS exports: ```bash @@ -504,6 +523,13 @@ - Add `rsize=1048576,wsize=1048576` for 1MB read/write blocks - Check link speed: `ethtool | grep Speed` +### Slow SMB transfers + +- Do not force Samba `socket options` buffer sizes unless you have benchmark data; Linux autotuning is usually better +- Confirm the datapool inherits `atime=off`: `zfs get -r atime dick` +- Check live SMB sessions and negotiated dialect: `smbstatus -b` +- Check the active link speed on skydick: `ethtool | grep Speed` + ### Files not showing up in media library The *arr stack (Sonarr/Radarr/Lidarr) hardlinks files from `/srv/media/data/` to diff --git a/hosts/skydick/datapool.nix b/hosts/skydick/datapool.nix index 37daa2e..f4d7861 100644 --- a/hosts/skydick/datapool.nix +++ b/hosts/skydick/datapool.nix @@ -31,7 +31,7 @@ # === Pool creation === # # zpool create -o ashift=12 -o autotrim=on -o failmode=continue \ -# -O compression=zstd -O relatime=on \ +# -O compression=zstd -O atime=off \ # -O xattr=sa -O acltype=posixacl -O dnodesize=auto \ # -O normalization=formD -O redundant_metadata=most \ # -O mountpoint=none -O canmount=off \ @@ -156,6 +156,10 @@ # ZFS quota on dick/users/ caps total across all child datasets. # dick/media is shared — no per-user quota; manage via service-level controls. # +# Access time: +# dick should carry atime=off so child datasets inherit it by default. This +# avoids metadata writes on reads across SMB/NFS-serving datasets. +# # Auth: # NFS all_squash provides UID mapping, not authentication. Per-user NFS here # uses one explicit export per user, which is acceptable for a small fixed set @@ -216,6 +220,32 @@ ]; + # Keep the manually created dick pool aligned with the documented policy. + systemd.services.dick-zfs-properties = { + description = "Apply ZFS properties for the dick datapool"; + wants = [ "zfs-mount.service" ]; + after = [ "zfs-mount.service" ]; + before = [ "nfs-server.service" "samba-smbd.service" ]; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; + + script = '' + set -euo pipefail + if ! ${pkgs.zfs}/bin/zpool list -H -o name dick >/dev/null 2>&1; then + exit 0 + fi + + # Child datasets on the datapool currently inherit the pool default. + # Setting the root keeps read-heavy SMB/NFS trees from generating atime + # metadata writes without having to stamp every descendant explicitly. + ${pkgs.zfs}/bin/zfs set atime=off dick + ''; + }; + systemd.services.samba-ldap-admin-password = { description = "Seed Samba LDAP admin password into secrets.tdb"; wants = [ "network-online.target" ]; @@ -302,19 +332,15 @@ "hosts allow" = "10.0. 127."; "hosts deny" = "ALL"; - "socket options" = "TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=1048576 SO_SNDBUF=1048576"; - "use sendfile" = "yes"; - "aio read size" = "16384"; - "aio write size" = "16384"; - "min receivefile size" = "16384"; + # Keep Samba on Linux defaults for socket buffers and multichannel. + # skydick's active 10 GbE NIC already exposes RSS queues, so manual + # interface capability tags or fixed SO_RCVBUF/SO_SNDBUF tuning would + # add complexity without a measured benefit. "map to guest" = "never"; "server min protocol" = "SMB2_10"; "load printers" = "no"; - - "server multi channel support" = "yes"; - }; # Shared datasets