ZFS, Actually Storage you can finally reason about.

Recordsize

concept
depth 2/3 − deeper + surface

ZFS stores each file in chunks, and recordsize is the setting that says how big those chunks may get—adjustable for each dataset, with a default of 128 kilobytes ("ZFS datasets use an internal recordsize of 128KB by default"—OpenZFS docs). It's a ceiling, not a straitjacket: small files simply use smaller chunks; nothing gets padded.

The mix-up to avoid: this is not about the disk's hardware. Recordsize is a choice you make per dataset, changeable anytime; the hardware story is a different setting (ashift, one page over) with very different rules.

When it matters: applications doing small random I/O inside large files. A database updating a 16K page inside a 50GB file under 128K records forces ZFS to read and copy-on-write 128K to change 16K—an 8× amplification on every hot-path write. Match the record to the I/O grain:

  • recordsize=16K for MySQL/InnoDB data files; ~32K (or the 128K default) works well for PostgreSQL (OpenZFS docs).
  • recordsize=1M for sequential, whole-file workloads—media, backups, archives ("Set recordsize=1M on datasets that are subject to sequential workloads"). Fewer, bigger blocks: less metadata, better compression.
  • Everything else: leave the 128K default alone. It's a good default.

The trap that catches everyone: "Changing the recordsize on a dataset will only take effect for new files" (OpenZFS docs). Tuning a dataset full of existing data changes nothing until the files are rewritten—copy them in again or accept the status quo.