Servers

NFS clients hang and server iowait spikes during ZFS pool scrub on a production storage host

Environment

Environment

Production storage server running ZFS on Linux (ZoL) on kernel 5.15, 24-bay RAID with SAS HDDs in raidz2, exports NFSv4 to multiple application servers, scheduled zpool scrub runs weekly at 02:00. Typical workload: mixed small metadata operations and large sequential reads. ARC size tuned low to reserve RAM for other services.

Symptoms

Symptoms

During scheduled weekly scrub NFS clients experience blocking reads/writes and NFS RPC timeouts; application latency spikes and some app threads hang waiting on file IO. iostat shows disks with %await approaching 100% and long write/seek latencies. The scrub completes but client availability impact is severe for the duration.

Observations

Observations

zpool status shows scrub progress and sustained high dsk activity. System shows high iowait and low free memory (ARC small), but no kernel crashes. No disk SMART warnings. Enabling NFS export 'async' temporarily masks some client stalls but application correctness tests fail intermittently. Attempting to throttle scrub via available ZFS module knobs not present or ineffective on current ZoL version.

Already attempted

Already attempted

Rescheduled scrub to low-traffic window (already at 02:00); tried increasing ARC size slightly during scrub (temporary improvement), tested scrub on a staging pool (reproducible effect on heavy metadata pools), tested reducing scrub frequency (not acceptable for data integrity). Upgraded ZFS package to latest stable for distro (no change).

Question

Question

How can I safely reduce the impact of ZFS scrubs on NFS clients without compromising data integrity? Which tunables and reversible mitigations should be applied on ZoL to throttle scrub IO, and when is escalation to storage vendor or kernel/ZFS community appropriate?

COMMUNITY RESPONSES

Verified community troubleshooting

0 replies

No answers yet..

Showing 0 of 0 community responses
AI DIAGNOSTICS

Incident analysis

Updated 1mo ago• Trouble ID

Most likely causes

ZFS scrub saturates disks (sequential and random IO) leading to high disk await and NFSd threads blocked — scrub not IO‑throttled on this ZoL version 80%
ARC set too small so scrub causes large numbers of cache misses and random disk seeks, worsening latency under scrub load 55%
Block layer I/O scheduler or queue depth settings not tuned for heavy background workloads, allowing scrub to monopolise dispatch slots 40%

Summary

Scrub processes perform full pool read of all blocks and can saturate disk IO, especially on pools with heavy metadata (many small files) or constrained ARC leading to increased seeks. NFS server threads block on disk IO, causing client RPC stalls. The immediate cause is scrub IO saturating disk queue leading to high await and NFS timeouts. Long-term solutions include throttling scrub IO, increasing cache to reduce random seeks, or moving scrubs to low-load windows. If ZoL version lacks scrub throttling knobs or if scrub implementation mismanages IO priority, community/vendor escalation is warranted.

Suggested Fixes

Diagnostic step 1
Avoid changing on-disk data during diagnostics. Schedule a maintenance window and snapshot current pool and NFS export config before making tunable changes.
Diagnostic step 2
Increase ZFS ARC (zfs_arc_max) temporarily during a scrub to reduce cache misses if memory is available; monitor hit ratio and client latency. This is reversible by restoring the previous ARC setting.
Diagnostic step 3
If available in your ZoL/kernel version, enable or tune ZFS scrub throttling parameters (module parameters that control scrubbing I/O priority or inter-scan delays). If parameters are not present, test on staging before rebooting production.