Designing ZFS dataset layout & recordsize on TrueNAS SCALE for mixed PostgreSQL + photo attachment workloads?

Hi all,

We are planning the on-premise TrueNAS SCALE storage configuration for an enterprise visitor management system deployed across a multi-tenant commercial tower.

The application runs on local app servers and connects over 10GbE iSCSI / NFS to TrueNAS for all persistent state, database storage, and audit asset retention.

The Workload Profile:

Our storage requirements are split into two very distinct I/O patterns:

  1. Transactional Database (PostgreSQL):

    • High-concurrency small random writes (4K–16K) logging real-time visitor check-ins, badge QR scans, and turnstile relay status events.
    • Synchronous writes are enforced for compliance so logs cannot be lost during an unexpected power event.
  2. Unstructured Photo Attachments (Compliance Retention):

    • Every visitor check-in captures a portrait camera photo and an ID document scan (JPEG/PNG, averaging 250KB – 1.5MB each).
    • This writes sequentially during peak morning check-in rushes (around 8:00 AM – 9:30 AM) and needs to be retained for at least 180 days for security audits.

Proposed Hardware:

  • 2U Server with 128GB ECC RAM.
  • Pool 1 (Fast Tier): 4x 1.92TB Enterprise NVMe SSDs in Striped Mirrors (RAID 10 equivalent) dedicated strictly to the PostgreSQL data directory.
  • Pool 2 (Capacity Tier): 6x 12TB SAS HDDs in RAIDZ2 for long-term visitor image archives and daily ZFS snapshots.

Questions for the Community:

  1. Dataset recordsize Tuning:

    • For the PostgreSQL dataset on Pool 1, is matching recordsize=16k to PostgreSQL’s page size still the recommended best practice on SCALE 24.04 (Dragonfish), or does ZFS compression (LZ4/ZSTD) make keeping the default 128k perform better under modern Linux kernel caching?
    • For the image storage dataset on Pool 2, should we increase recordsize=1M to minimize metadata overhead for the ~500KB–1MB visitor photos?
  2. ZFS Snapshot Replication Locks:

    • We plan to run automated hourly ZFS snapshot replications to a secondary TrueNAS box for offsite disaster recovery. In your experience, does snapshot creation introduce any noticeable I/O pause on the primary PostgreSQL NVMe pool during active peak morning check-in traffic?

Would love to hear how other sysadmins and storage engineers partition datasets for mixed database + media asset workloads on TrueNAS!

This is something you should be contacting the TrueNAS company for Enterprise help.