Applications are stalling on storage calls, zpool iostat -l shows ugly latency numbers, and someone has already said “the disks are dying.” Before you open a hardware ticket, look at which latency column is actually elevated. ZFS reports total wait, disk wait, and queue wait separately, and the split between them tells you whether the problem is the devices or something inside ZFS itself.
The most common misdiagnosis is treating high total_wait as a disk problem. total_wait includes queueing time inside ZFS: ZIL commits, TXG sync pressure, dirty data throttling, fragmentation-driven allocation cost, and competition from scrub or resilver. If disk_wait is low while total_wait is high, your disks are fine and the bottleneck is above them.
This guide covers reading the latency output correctly, correlating it with queue depth and TXG state, and fixing the actual cause. It assumes a working knowledge of TXGs, the ARC, and the ZIL. If you need that background, start with How ZFS actually works in production.
What this means
zpool iostat -l (available since OpenZFS 0.7.0) reports average latency per pool or per vdev, broken into separate columns:
- total_wait: average total I/O time, queueing plus disk service.
- disk_wait: average time the I/O spent at the disk only.
- syncq_wait: time spent in the synchronous priority queues. This is the ZIL/SLOG path.
- asyncq_wait: time spent in the asynchronous priority queues. This is the TXG commit path.
- scrub / trim / rebuild: time I/O spent queued behind the scrub, TRIM, or rebuild (sequential resilver) queues.
Each column has read and write sub-columns. The single most useful move is total_wait minus disk_wait: the difference is time the I/O spent inside ZFS before it ever reached a device.
flowchart TD
A[total_wait high on zpool iostat -l] --> B{disk_wait also high?}
B -- Yes --> C[Backend problem: slow vdev, saturation, or dying device]
B -- No --> D{Which queue wait dominates?}
D -- syncq_wait --> E[ZIL / SLOG path: sync writes stalled]
D -- asyncq_wait --> F[TXG commit path: sync pressure or dirty data throttling]
D -- scrub / rebuild --> G[Scrub or resilver inflating latency - expected]
D -- none clearly --> H[Check -q queue depth and txgs stime]Two instrumentation facts shape how you read this output:
-lreports averages. Bursty latency spikes get smoothed out. Usezpool iostat -wfor latency histograms so you can see the tail buckets, which are what applications actually feel.- Scrubs and resilvers legitimately inflate latency. Scrub I/O queues behind application I/O at lower priority, so the
scrubcolumn and overall wait times climb during a scan window without anything being wrong.
Common causes
| Cause | What it looks like | First thing to check |
|---|---|---|
| ZIL/SLOG bottleneck | Write total_wait high, disk_wait low, syncq_wait dominates; databases/NFS stall on fsync | SLOG device state in zpool status -v; dataset sync property |
| TXG sync pressure / dirty data throttling | Write asyncq_wait climbing, latency spikes with a periodic rhythm, reads fine | stime in /proc/spl/kstat/zfs/<pool>/txgs vs zfs_txg_timeout |
| Backend saturation | total_wait and disk_wait both high, pending queue depth growing | zpool iostat -q -v 1 per-vdev pend counts |
| Single slow vdev | One vdev’s latency consistently much higher than its peers | zpool iostat -l -v 1, compare per-vdev columns |
| Scrub or resilver running | scrub or rebuild wait column elevated, all other latency up | zpool status scan line |
| Capacity/fragmentation cliff | Write latency creeps up over weeks, pool above ~85%, fragmentation rising | zpool list -o name,cap,frag |
| ARC starvation pushing reads to disk | Read latency high, ARC hit rate falling, memory_throttle_count incrementing | /proc/spl/kstat/zfs/arcstats |
Quick checks
All read-only, safe to run during an incident:
# 1. Average latency per vdev, 1-second samples
zpool iostat -l -v 1
# 2. Latency histograms: the tail latency that averages hide
zpool iostat -w 5
# 3. Queue depths per vdev: pend growing means backend saturation
zpool iostat -q -v 1
# 4. Is a scrub or resilver running right now?
zpool status | grep -A5 scan
# 5. Recent TXG sync durations (stime column, nanoseconds)
cat /proc/spl/kstat/zfs/<pool>/txgs | tail -20
# 6. Pool capacity and fragmentation together
zpool list -o name,size,alloc,free,cap,frag
# 7. Memory pressure on the ARC (read-latency cause)
grep -E "^(size|c_max|hits|misses|memory_throttle_count)" /proc/spl/kstat/zfs/arcstats
# 8. Kernel-side device problems
dmesg | grep -i -E "ata|sas|reset|timeout" | tail -20
Reading notes:
- On the
-qoutput, sustained pending much greater than active on the same vdev means that device is saturated. Pending near zero while latency stays high means the delay is inside ZFS, not the device. - On the
txgskstat,stimeis the sync phase duration. Consistently above the TXG timeout (default 5 seconds viazfs_txg_timeout) means the pool cannot flush dirty data as fast as it accumulates. - SLOG health is easy to miss. A slow (not yet faulted) SLOG device is invisible to pool redundancy and
zpool status -x, while sync write latency jumps. Check thelogssection ofzpool status -vexplicitly.
How to diagnose it
Work through these in order. Each step narrows the layer.
Rule out the expected explanation first. Run
zpool statusand check the scan line. If a scrub or resilver is in progress, elevatedtotal_waitand a largescruborrebuildwait column are expected behavior, not an incident. Scrubs are I/O intensive and compete with production I/O by design. Note the window and re-measure after it completes.Split total_wait from disk_wait. Run
zpool iostat -l 1for 30-60 seconds. Ifdisk_waittrackstotal_wait, the devices are slow: go to step 5. Ifdisk_waitstays low whiletotal_waitis high, the contention is inside ZFS. Continue.Check the histogram, not just the average. Run
zpool iostat -w 5. Averages smooth out bursts; the histogram shows whether you have a healthy unimodal distribution or a tail of I/Os landing in the high-latency buckets. A small fraction of I/Os in the worst buckets is often what the application is actually complaining about.Read the queue wait split. High
syncq_waiton writes points at the ZIL/SLOG path: synchronous writes (fsync, O_SYNC, NFS) are stalling before they reach disk. Highasyncq_waiton writes points at the TXG commit path. For the syncq case, check SLOG device state inzpool status -vand confirm which datasets actually need sync semantics (zfs get sync <dataset>). For the asyncq case, continue to step 6.If disk_wait is genuinely high, find the slow device. Run
zpool iostat -l -v 1and compare vdevs. One vdev consistently 3x or more slower than its peers is a dying or degraded device, even ifzpool status -xreports healthy. Check per-device READ/WRITE/CKSUM counters inzpool status, device SMART data, anddmesgfor link resets. In a RAIDZ vdev, the slowest disk sets the write latency for the whole stripe.Confirm TXG pressure. Read
/proc/spl/kstat/zfs/<pool>/txgsand watchstimeandndirtyover a few minutes.stimeregularly exceeding 2xzfs_txg_timeout(over ~10 seconds with defaults) means the write pipeline is saturated. Cross-check dirty data againstzfs_dirty_data_max(/sys/module/zfs/parameters/zfs_dirty_data_max); ZFS begins throttling writers atzfs_delay_min_dirty_percent(default 60%) of that limit, and throttling shows up as write latency that looks exactly like slow disks. See ZFS dirty data throttling for the full mechanism.Check the capacity-fragmentation axis. If
zpool list -o name,cap,fragshows capacity above ~85% and fragmentation climbing, metaslab allocation is getting expensive and every write pays for it. This is a slow-creep cause, not a sudden one, and it amplifies everything above.For read latency, check the ARC before the disks. If read
total_waitis high but the workload used to be fast, check ARC hit rate andmemory_throttle_countin/proc/spl/kstat/zfs/arcstats. A shrinking ARC forces reads to disk and produces exactly the “suddenly slow storage” symptom. See ZFS ARC hit ratio low and ZFS ARC shrinking below c_max.
Metrics and signals to monitor
| Signal | Why it matters | Warning sign |
|---|---|---|
total_wait vs disk_wait (r/w) | Separates ZFS-internal contention from device slowness | Gap widening between the two |
syncq_wait (write) | ZIL/SLOG health for sync workloads | Sustained elevation; fsync-heavy apps stalling |
asyncq_wait (write) | TXG commit path congestion | Climbing trend, periodic spikes |
-w histogram tail | What applications actually feel; averages hide it | Tail buckets growing while mean looks fine |
-q pend per vdev | Leading indicator of backend saturation | Pending » active sustained |
TXG stime | Whether the pool can flush dirty data in time | Consistently > 2x zfs_txg_timeout |
Dirty data vs zfs_dirty_data_max | How close the write pipeline is to the hard stall | Sustained above 80% of max |
Pool cap and frag | The slow-creep amplifier behind write latency | cap > 85% with frag rising |
scrub/rebuild wait columns | Explains legitimate latency inflation windows | Elevated only during scan windows |
Latency severity thresholds from field experience: sync-heavy workloads (databases, NFS) should see total_wait under roughly 10-50ms; async workloads tolerate up to ~100ms; anything sustained above 1 second indicates a serious problem. Treat these as baseline-relative: alert on divergence from your own rolling baseline and on histogram tail growth, not on a single absolute number, because scrub windows will otherwise false-fire every week.
Fixes
ZIL/SLOG bottleneck
- Confirm the SLOG device is healthy in
zpool status -v. A failed SLOG falls back to the pool vdevs for the ZIL, which is a large latency jump for sync workloads but no data loss. Replace a failed SLOG withzpool replace. - Check
zfs get syncper dataset. Do not setsync=disabledon databases or NFS exports to chase latency; that trades crash consistency for speed. - If there is no SLOG and the workload is sync-heavy (NFS, databases), adding a low-latency, power-loss-protected SLOG device is the structural fix. Mirror it: an unmirrored SLOG that fails across a crash can lose recently synced data.
- Tradeoff: a SLOG only helps synchronous writes. If
syncq_waitis low andasyncq_waitis high, a SLOG does nothing.
TXG pressure and dirty data throttling
- If a scrub or resilver is consuming I/O bandwidth during a write burst, pausing the scrub (
zpool scrub -p <pool>, where supported) relieves the pressure at the cost of delaying integrity verification. - Identify and throttle the write source if possible (bulk loads, rsync, backup jobs).
zfs_dirty_data_maxcan be raised on systems with RAM headroom to absorb larger bursts. Tradeoff: bigger bursts mean bigger TXG syncs, which can extendstimefurther if the backend is the real constraint. Raising the limit when the disks genuinely cannot keep up just moves the stall.- Do not reach for hardware replacement here. This pattern (high
asyncq_wait, lowdisk_wait, periodic write freezes) is ZFS working as designed against a flush-rate problem.
Backend saturation or single slow vdev
- If one vdev is consistently much slower than its peers and its error counters are incrementing, plan proactive replacement before it faults. In a RAIDZ1 vdev this is urgent: you are one failure from data loss.
- If all vdevs are saturated (pend » active across the pool,
disk_waithigh), the pool needs more IOPS: add vdevs, or move hot datasets. ZFS stripes across top-level vdevs, so adding vdevs helps new writes immediately; existing data is not restriped. - Check
dmesgfor SATA/SAS link resets and controller timeouts before assuming media failure.
Capacity and fragmentation
- Prune snapshots holding space:
zfs list -t snapshot -o name,used,refer -s used -r <pool>. Deleting files does not free space that snapshots still reference. - There is no in-place defragmentation in ZFS. Scrub does not defragment. The only real fix for severe fragmentation is
zfs send | zfs recvinto a fresh pool. Plan for this; it is not an incident-time action. - Keep write-heavy pools below ~85% capacity. See ZFS capacity planning.
ARC-driven read latency
- If
memory_throttle_countis incrementing and ARC size is falling under application pressure, set an explicitzfs_arc_maxso the ARC and applications stop fighting. See ZFS zfs_arc_max tuning and ZFS ARC and the OOM killer. - If the working set simply outgrew RAM, the fix is more RAM, an L2ARC that actually fits the workload, or reducing the working set.
Prevention
- Baseline the histogram, not the average. Collect
zpool iostat -wdistributions continuously so tail baselines exist before the incident. Alerting on averages alone misses the tail and fires late. - Alert on the split, not the total. Track
total_waitminusdisk_waitper pool. A widening gap is an early warning of TXG or ZIL trouble while users are still happy. - Track TXG stime and dirty data pressure as leading indicators. They move before latency does.
- Trend capacity and fragmentation together. The latency they cause arrives gradually and is expensive to reverse.
- Monitor SLOG device health and wear via device-level SMART/NVMe indicators. There is no ZFS-level kstat for SLOG write volume.
- Schedule scrubs deliberately and annotate their windows, so latency inflation during scans is recognized as expected instead of paged on.
- Cover the baseline signals in ZFS monitoring checklist: the signals every production pool needs so latency alerts arrive with the context (queue depth, TXG state, ARC pressure) already attached.
How Netdata helps
- Netdata’s ZFS collector charts pool I/O latency per pool, so the total-vs-disk split is visible as a time series rather than a one-off command during the incident.
- ARC statistics from
/proc/spl/kstat/zfs/arcstats(size, hit rate,memory_throttle_count) are charted alongside pool latency, which makes the “read latency up because ARC is shrinking” correlation immediate. - TXG sync duration from the per-pool
txgskstat can be correlated with write latency spikes to confirm TXG pressure instead of guessing. - Per-vdev throughput and queue depth views let you spot the single slow device in a mirror or RAIDZ group without sampling
zpool iostat -vby hand. - Because scrub windows, capacity, and fragmentation are charted on the same host, legitimate latency inflation from scans is visually separable from a real regression.
Related guides
- ZFS ARC hit ratio low: cache misses, cold caches, and working sets that outgrew RAM
- ZFS zfs_arc_max: capping the ARC without starving read performance
- ZFS ARC and the OOM killer: applications killed while the cache will not shrink fast enough
- ZFS ARC shrinking below c_max: reading memory pressure before latency hits
- ZFS ARC using all memory: the Linux default that eats your RAM
- ZFS capacity planning: runway estimation before the pool fills
- ZFS checksum errors (CKSUM): the definitive signal of silent corruption
- ZFS checksum errors on multiple devices: suspect RAM or the controller, not the disks
- ZFS device UNAVAIL or REMOVED: a disk that fell off the bus
- ZFS dirty data throttling: the write delay that masquerades as slow disks
- How ZFS actually works in production: a mental model for operators
- ZFS monitoring checklist: the signals every production pool needs






