Home / Guides / ZFS Record Size Explained

Guide

ZFS Record Size Explained

Updated 2026-11-21

ZFS record size affects how data is written, compressed, checksummed, snapshotted, and recovered. This guide explains practical settings for file shares, databases, VMs, and mixed NAS workloads without treating one value as universally best.

ZFS record size controls the maximum logical block size ZFS uses for files in a dataset. It influences write amplification, compression efficiency, snapshot space usage, random I/O behavior, and how much data may need to be read or rewritten for a small change.

The practical answer is:

  • Use a larger record size for large sequential files such as media, backups, and disk images.
  • Use a smaller record size for workloads dominated by small random updates, such as some databases and virtual machines.
  • Tune datasets separately instead of forcing one record size across the entire pool.
  • Benchmark the actual application. Record size is important, but it cannot compensate for unsuitable disks, insufficient RAM, weak networking, poor backup design, or an inappropriate vdev layout.

A record-size change normally affects new writes. It does not automatically rewrite existing data, so changing the property may require copying data into a newly configured dataset if you need old files to use the new layout.

What ZFS record size means

ZFS stores file data in records. A record is a logical unit that ZFS can compress, checksum, write, clone, and reference in snapshots.

The recordsize property sets the maximum record size for regular files in a dataset. A file smaller than the setting may occupy a smaller record. Files larger than the setting are divided into multiple records.

For example, with a 128 KiB record size:

  • A 20 KiB file may use one smaller record.
  • A 1 GiB video file is divided into many records of up to 128 KiB.
  • A small overwrite may cause ZFS to read, modify, checksum, compress, and write the affected record, depending on the workload and storage path.

The property does not mean that every file consumes exactly that amount of physical disk space. Compression, record tails, sparse data, metadata, RAIDZ layout, and copy-on-write behavior all affect actual allocation.

Record size is also not the same as:

  • The filesystem block size inside a guest operating system.
  • The sector size selected with ashift.
  • The RAIDZ stripe width.
  • The network packet or Ethernet frame size.
  • The block size of a zvol, which is generally controlled with volblocksize.

Why record size matters for failure prevention and recovery

Record size is primarily a performance and space-efficiency setting, but it also affects the amount of data involved in integrity checking and recovery.

Checksums protect records from silent corruption

ZFS stores checksums for data and metadata. When a block is read, ZFS can verify that the data still matches its checksum. With redundant storage, ZFS can often reconstruct a damaged block from another copy or parity and then return corrected data to the application.

This helps detect and repair corruption caused by issues such as:

  • A failing disk returning incorrect data.
  • Damaged sectors.
  • Faulty cables, controllers, or memory paths.
  • Bit rot over time.
  • Inconsistent data delivered by lower storage layers.

A checksum does not prevent every failure. It identifies data that does not match what ZFS expects. Recovery depends on having a valid redundant copy or parity and on the problem not affecting all available copies.

Larger records can reduce metadata overhead

Large sequential files can benefit from larger records because the filesystem has fewer logical blocks to track. That can reduce metadata overhead and improve compression opportunities.

For a media library or backup dataset, this may be useful because files are commonly:

  • Large.
  • Read sequentially.
  • Written once or infrequently modified.
  • Naturally compressible only in some cases.

Smaller records can limit small-update work

A smaller record can reduce the amount of data involved in a small random overwrite. This matters for workloads that repeatedly update small regions of large files.

However, smaller records increase the number of blocks and metadata operations needed for a large file. They can also reduce compression efficiency and sequential throughput in some workloads.

The trade-off is therefore not “small is safer” or “large is safer.” It is about how much data ZFS handles per logical update and how efficiently it can store and verify the workload.

Recovery is not the same as backup

ZFS checksums and redundancy can detect and repair certain forms of corruption, but they do not replace a backup.

A pool can lose data even when checksums are enabled if:

  • All redundant copies of a block are damaged.
  • Multiple disks fail beyond the vdev's recovery capability.
  • A user deletes or encrypts files.
  • A pool is destroyed by fire, theft, flooding, or a power event.
  • The corruption is replicated to every copy before detection.
  • Administrative or software errors remove the data.

Snapshots can provide rollback against accidental deletion or some ransomware scenarios, but snapshots normally reside in the same pool. They are not an offsite backup.

A practical design separates these functions:

FeatureMain purposeProtects against
ChecksumsDetect corrupted dataSilent corruption and some bad reads
Mirror or RAIDZ redundancyReconstruct failed blocks or disksCertain disk failures
SnapshotsPreserve previous dataset statesAccidental changes and some rollback scenarios
ReplicationCopy datasets to another system or poolSome local pool failures
BackupMaintain an independent recovery copyDeletion, disaster, theft, and major system failure

Record size, RAID, and vdev design

Record size does not determine whether a pool is safe. RAID level and vdev layout determine much of the pool's disk-failure tolerance.

A record is written across the available storage according to the vdev type and allocation rules. On mirrors, data is copied to multiple disks. On RAIDZ, data and parity are distributed across the vdev.

Changing record size cannot turn an unsuitable RAIDZ or mirror layout into a resilient one. Before tuning records, decide:

  1. How much usable capacity is required?
  2. How many disk failures must each vdev tolerate?
  3. How quickly can failed drives be replaced?
  4. Is the workload mostly sequential or random?
  5. Is the pool intended for primary data, backups, or both?
  6. Can the system be expanded in the way you expect?

Also keep ashift separate from recordsize. ashift concerns the storage device's sector alignment, while recordsize concerns logical filesystem records. A record-size change is not a substitute for correct sector alignment.

Recommended starting points by workload

These are starting points, not universal prescriptions. Exact behavior depends on the ZFS implementation, operating system, disks, compression, vdev type, application, and workload mix.

Large media files

For movies, TV recordings, music libraries, photos, and other large files that are mostly read sequentially, a larger record size is often a sensible starting point.

Benefits may include:

  • Lower metadata overhead.
  • Better sequential throughput.
  • More efficient compression for suitable data.
  • Fewer logical blocks for large files.

Potential drawbacks include:

  • More data involved in some small overwrites.
  • Less attractive behavior for databases stored in the same dataset.
  • More space or write work for frequently modified regions of large files.

Keep media in its own dataset if it has different requirements from documents, application data, or databases.

Backup repositories

Backup data often consists of large files or backup chunks and is commonly written sequentially. A larger record size may fit well, but the correct choice depends on the backup application.

Some backup programs perform:

  • Large sequential writes.
  • Deduplicated chunk writes.
  • Frequent metadata updates.
  • Random access to many small chunks.
  • Synthetic full backups that rewrite existing data.

If the repository performs substantial random updates, benchmark it rather than assuming that a media-oriented setting will be optimal.

Documents and general file shares

Office files, PDFs, source code, and home-directory data are mixed workloads. A moderate or default record size is usually a reasonable place to begin.

The important design decisions may be more significant than fine-tuning:

  • Use snapshots where appropriate.
  • Set quotas or reservations deliberately.
  • Enable compression if it benefits the data.
  • Avoid filling the pool close to capacity.
  • Provide adequate network bandwidth.
  • Back up irreplaceable files independently.

Databases

Databases issue their own reads and writes based on database pages, logs, indexes, and checkpoint behavior. A database's page size and I/O pattern matter more than the fact that it is called a database.

A smaller record size may reduce read-modify-write work for small random updates. It may also increase metadata overhead and reduce the efficiency of large sequential operations.

Database-specific considerations include:

  • Put the database in a dedicated dataset when possible.
  • Test record sizes against the database's page and log behavior.
  • Consider separate datasets for data files, write-ahead logs, and temporary files.
  • Do not assume a record-size change will fix a sync-write bottleneck.
  • Confirm how the database handles durability before changing synchronous-write settings.
  • Monitor latency, not only throughput.

A database may appear fast in a simple benchmark while suffering under concurrent transactions, checkpoints, replication, or realistic cache pressure.

Virtual machines

Virtual machine storage is a special case because there are two storage layers:

  1. The guest filesystem and its block size.
  2. The ZFS dataset or zvol underneath it.

For a VM stored as a file, recordsize applies to the dataset containing that file. For a zvol, the relevant property is generally volblocksize, which is selected for the zvol rather than controlled by the dataset's recordsize.

A VM workload can include:

  • Small random guest writes.
  • Large sequential virtual disk operations.
  • Guest filesystem metadata changes.
  • Database activity inside the guest.
  • Snapshot and clone operations.

Use a dedicated dataset or zvol and benchmark it with realistic workloads. Avoid treating a VM image like a movie file simply because both may be large.

Record size and compression

ZFS compresses records rather than compressing an entire file as one object. A larger record can give the compression algorithm more data to evaluate, which may improve compression for suitable content.

This is workload-dependent:

  • Text, logs, database pages, and some virtual disk content may compress.
  • Already-compressed video, JPEG images, encrypted files, and compressed archives usually compress poorly.
  • Smaller records may reduce the amount of data processed for a small change.
  • Larger records may improve compression ratio or reduce metadata for sequential data.

Compression changes the relationship between logical and physical I/O. A workload may issue a large logical write but store less physical data after compression. Conversely, incompressible data still consumes physical space and bandwidth.

Measure both:

  • Logical throughput seen by the application.
  • Physical disk throughput.
  • Compression ratio.
  • Latency under concurrent load.
  • Pool capacity consumed over time.

Record size, snapshots, and copy-on-write

ZFS uses copy-on-write. When modified data is written, ZFS writes new blocks and updates metadata rather than overwriting the old block in place. Snapshots preserve references to older blocks.

This has several consequences:

  • A small change can keep an older record alive if a snapshot still references it.
  • Frequent updates to large records can increase snapshot space usage.
  • Smaller records may reduce the amount of unchanged data retained by a snapshot for some update patterns.
  • Large sequential writes may be efficient even when snapshots are enabled.
  • Snapshot space consumption depends on the rate and pattern of changes, not just the number of snapshots.

For example, if an application repeatedly modifies small portions of a large file, a large record may result in more new data being written per change than a smaller record. But the actual result depends on compression, application write behavior, sparse regions, and whether the application rewrites whole files or performs small overwrites.

Monitor snapshot usage instead of estimating it from record size alone.

RAM and performance implications

Record size does not simply allocate one record's worth of RAM for every file. ZFS uses RAM for multiple purposes, including:

  • The Adaptive Replacement Cache, or ARC.
  • Metadata.
  • Checksums and other bookkeeping.
  • Deduplication tables, if deduplication is enabled.
  • Application and filesystem operations.
  • Virtual machine or container workloads.

Larger records can affect memory pressure indirectly:

  • Fewer large-file blocks may reduce metadata overhead.
  • Large records can create larger I/O operations and cached blocks.
  • Random workloads may cache data that is larger than the application frequently needs.
  • Snapshots and fragmented workloads can increase metadata demands.
  • Deduplication has separate and often substantial memory implications.

Do not use record size as a substitute for sizing system RAM. The right amount of RAM depends on workload, services, caching expectations, deduplication, virtualization, and the operating system. If the system swaps heavily or runs out of memory, record-size tuning is unlikely to solve the underlying problem.

Throughput versus latency

A larger record size may help sequential throughput, but application responsiveness is often determined by latency and I/O concurrency.

A useful network sanity check is:

Theoretical MB/s = Network bandwidth in Gbps × 1,000 / 8

For example:

10 Gbps × 1,000 / 8 = 1,250 MB/s theoretical

Actual file-transfer performance is lower because of protocol overhead, encryption, CPU limits, filesystem work, disk performance, RAIDZ or mirror behavior, and the client. A record-size change cannot make a network link exceed its practical limits.

For databases and VMs, measure:

  • Average and tail latency.
  • Small random read and write performance.
  • Synchronous write latency.
  • Queue depth.
  • Performance with snapshots enabled.
  • Behavior when the ARC no longer contains the working set.

SSD cache does not fix a poor record-size choice

ZFS cache devices and special vdevs serve different purposes, and terminology varies by platform.

An L2ARC is a read cache. It is not a replacement for adequate RAM and does not make every workload faster. A separate log device, often called a SLOG when used for the ZFS intent log, is intended for specific synchronous-write behavior; it is not a general write cache for all asynchronous writes.

A special vdev may hold metadata or selected small blocks depending on configuration. It requires careful redundancy planning because losing a special vdev can affect pool availability or data access.

Before adding SSDs:

  1. Identify whether the bottleneck is reads, synchronous writes, random writes, metadata, CPU, or networking.
  2. Confirm that the SSD role matches that bottleneck.
  3. Plan redundancy for the SSD device or vdev.
  4. Check endurance and power-loss behavior.
  5. Benchmark with the real application.

A cache device cannot correct a poor backup strategy, insufficient redundancy, or a dataset configured for the wrong workload.

How to test record-size choices

A useful test compares realistic configurations rather than isolated synthetic throughput.

Test procedure

  1. Create separate test datasets or zvols.
  2. Use the same compression, sync, encryption, and quota policies you expect in production.
  3. Test at least two plausible record or volume block sizes.
  4. Use representative file sizes and access patterns.
  5. Test with and without snapshots if snapshots will be used.
  6. Fill the test area enough to expose fragmentation and capacity effects.
  7. Repeat tests after the ARC is warm and after the working set exceeds available cache.
  8. Monitor CPU, RAM, ARC behavior, disk latency, IOPS, throughput, and network utilization.
  9. Test failure and recovery procedures separately from performance.

Synthetic benchmarks can be useful, but they may produce misleading results if they do not match the application. A database benchmark should resemble the expected transaction and checkpoint workload. A VM test should include the guest operating system and intended applications. A backup test should model the backup software's chunking, deduplication, and retention behavior.

Common record-size mistakes

Using one dataset for everything

A single dataset may contain media, documents, databases, and VM images. That prevents workload-specific properties and makes snapshot, quota, compression, and replication policies harder to manage.

Separate datasets are often more useful than trying to find one perfect record size.

Changing the property and expecting old data to change

Changing recordsize does not generally rewrite existing blocks. New writes may use the new property, while old data retains its existing layout.

To rewrite existing content, you may need to copy it into a newly configured dataset and verify the copy before removing the original.

Confusing record size with RAID stripe width

Record size affects logical filesystem blocks. RAIDZ layout affects how blocks are distributed across disks. A larger record does not automatically guarantee perfect stripe alignment, and a smaller record does not automatically eliminate write amplification.

Assuming smaller is always better for databases

Small records can help certain random-update workloads, but they can also increase metadata, reduce compression efficiency, and hurt sequential operations. Database behavior must be measured.

Assuming larger is always better for media

Large records often suit large sequential files, but a media dataset may also contain thumbnails, indexes, subtitles, application databases, or frequently rewritten metadata. Keep those workloads separate when their behavior differs.

Treating snapshots as backups

Snapshots share the pool's failure domain. Maintain independent backups and test restoration.

Optimizing before protecting the data

A tuned pool with no tested backup is still a risky storage system. Establish redundancy, monitoring, snapshots, and backup recovery first, then optimize performance.

Filesystem decision checklist

Use this checklist before choosing a record size or changing an existing dataset.

Workload

  • Are the files mostly large and sequential, or small and randomly updated?
  • Will applications rewrite small regions of large files?
  • Are databases, VM images, and media stored separately?
  • Does the application use its own page, chunk, or block size?
  • Are synchronous writes important?

Dataset layout

  • Can each major workload have its own dataset?
  • Do snapshot and replication policies differ between workloads?
  • Will quotas, reservations, compression, or encryption differ?
  • Are you tuning a regular filesystem dataset or a zvol?

Pool and redundancy

  • Is the mirror or RAIDZ design appropriate for the required failure tolerance?
  • Is there enough usable capacity after accounting for redundancy and free-space headroom?
  • Is the pool's expansion path acceptable?
  • Is ashift appropriate for the storage devices?
  • Are all critical vdevs and special devices protected against the required failures?

Integrity and recovery

  • Are checksums enabled as provided by the filesystem design?
  • Are scrubs scheduled and monitored?
  • Are disk, pool, and checksum errors alerted?
  • Are snapshots limited so they do not unexpectedly consume capacity?
  • Is there an independent, tested backup?
  • Can you restore individual files and the entire service?

Performance and hardware

  • Is RAM adequate for the workload?
  • Is the network fast enough for the expected transfers?
  • Are the drives suitable for NAS duty and the write workload?
  • Is power-loss protection needed for SSDs or synchronous-write workloads?
  • Is an SSD cache or special device justified by measured behavior?
  • Have you tested latency, throughput, and recovery under realistic conditions?

Final selection

  • Start with a conservative default or workload-appropriate value.
  • Use separate datasets for materially different workloads.
  • Benchmark before and after changing the property.
  • Remember that a property change affects new writes unless existing data is rewritten.
  • Document the setting and the reason for it.
  • Recheck the choice after adding applications, snapshots, or virtual machines.

For hardware and storage-system options that can support these designs, Browse NAS and compare NAS and storage servers. Choose the platform only after defining the pool layout, drive redundancy, network requirements, backup destination, and workload-specific datasets.

Related guides