ZPOOL-IOSTAT(8)
π zpool-iostat β display logical I/O statistics for ZFS storage pools π
okay bestie, welcome to zpool-iostat(8) β¨ this is the little number that lives in the System Manager's Manual and it's literally your all-access pass to watching your ZFS storage pools breathe. grab a strawberry drink π, we're reading I/O stats together.
πΈ SYNOPSIS πΈ
zpool iostat [[[-c SCRIPT] [-lq]]|-rw] [-T u|d] [-ghHLnpPvy]
[poolβ¦|[pool vdevβ¦]|vdevβ¦] [interval [count]]
π¦ DESCRIPTION π¦
So what does it even do. It displays logical I/O statistics for the pools/vdevs you point at. π
ngl if you want physical I/O stats instead, that's a whole other thing β go look at iostat(1). and here's a fun little detail: if writes happen to be located nearby, they may be merged into a single larger operation. also, additional I/O may be generated depending on the level of vdev redundancy. lowkey important!
Wanna filter the output? you can pass in:
- a list of pools,
- a pool and a list of vdevs in that pool,
- or a list of any vdevs from any pool.
if you specify nothing at all, you get statistics for every pool in the system. main character behavior honestly π
Now the timing stuff β¨ when you give it an interval, the statistics are printed every interval seconds until killed (yes, until killed π). If the -n flag is specified the headers are displayed only once β otherwise they're displayed periodically. If you specify count, the command exits after count reports are printed.
β IMPORTANT, no cap: the first report printed is always the statistics since boot, regardless of whetherintervalandcountare passed. You can suppress that behavior with the-yflag though π«Ά
also note that the units of K, M, G⦠that are printed in the report are in base 1024. to get the raw values, use the -p flag.
π the options, one by one, periodt π
-c [SCRIPT1[,SCRIPT2]β¦]β Run a script (or scripts) on each vdev and include the output as a new column in thezpool iostatoutput. Users can run any script found in their~/.zpool.ddirectory or from the system/etc/zfs/zpool.ddirectory. Script names containing the slash (/) character are not allowed π«. The default search path can be overridden by setting theZPOOL_SCRIPTS_PATHenvironment variable. A privileged user can only run-cif they have theZPOOL_SCRIPTS_AS_ROOTenvironment variable set. If a script requires the use of a privileged command, likesmartctl(8), then it's recommended you allow the user access to it in/etc/sudoers.
If -c is passed without a script name, it prints a list of all scripts. -c also sets verbose mode (-v). π
Script output should be in the form of "name=value". The column name is set to "name" and the value is set to "value". Multiple lines can be used to output multiple columns. The first line of output not in the "name=value" format is displayed without a column title, and no more output after that is displayed. This can be useful for printing error messages. Blank or NULL values are printed as a - to make output AWKable. π§
The following environment variables are set before running each script:
VDEV_PATHβ Full path to the vdevVDEV_UPATHβ Underlying path to the vdev (/dev/sd*). For use with device mapper, multipath, or partitioned vdevs.VDEV_ENC_SYSFS_PATHβ The sysfs path to the enclosure for the vdev (if any).
-T u|dβ Display a time stamp π. Specifyufor a printed representation of the internal representation of time β seetime(1). Specifydfor standard date format β seedate(1).-gβ Display vdev GUIDs instead of the normal device names. These GUIDs can be used in place of device names for thezpool detach/offline/remove/replacecommands. iconic β¨-Hβ Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.-Lβ Display real paths for vdevs, resolving all symbolic links. This can be used to look up the current block device name regardless of the/dev/disk/path used to open it.-nβ Print headers only once when passed.-pβ Display numbers in parsable (exact) values. Time values are in nanoseconds.-Pβ Display full paths for vdevs instead of only the last component of the path. This can be used in conjunction with the-Lflag. π«Ά-rβ Print request size histograms for the leaf vdev's I/O. This includes histograms of individual I/O (ind) and aggregate I/O (agg). These stats can be useful for observing how well I/O aggregation is working. Note that TRIM I/O may exceed 16M, but will be counted as 16M π.-vβ Verbose statistics. Reports usage statistics for individual vdevs within the pool, in addition to the pool-wide statistics.-yβ Normally the first line of output reports the statistics since boot: suppress it. π-wβ Display latency histograms:total_waitβ Total I/O time (queuing + disk I/O time).disk_waitβ Disk I/O time (time reading/writing the disk).syncq_waitβ Amount of time I/O spent in synchronous priority queues. Does not include disk time.asyncq_waitβ Amount of time I/O spent in asynchronous priority queues. Does not include disk time.scrubβ Amount of time I/O spent in scrub queue. Does not include disk time.rebuildβ Amount of time I/O spent in rebuild queue. Does not include disk time.
-lβ Include average latency statistics:total_waitβ Average total I/O time (queuing + disk I/O time).disk_waitβ Average disk I/O time (time reading/writing the disk).syncq_waitβ Average amount of time I/O spent in synchronous priority queues. Does not include disk time.asyncq_waitβ Average amount of time I/O spent in asynchronous priority queues. Does not include disk time.scrubβ Average queuing time in scrub queue. Does not include disk time.trimβ Average queuing time in trim queue. Does not include disk time.rebuildβ Average queuing time in rebuild queue. Does not include disk time.
-qβ Include active queue statistics. Each priority queue has both pending (pend) and active (activ) I/O requests. Pending requests are waiting to be issued to the disk, and active requests have been issued to disk and are waiting for completion. These stats are broken out by priority queue:syncq_read/writeβ Current number of entries in synchronous priority queues.asyncq_read/writeβ Current number of entries in asynchronous priority queues.scrubq_readβ Current number of entries in scrub queue.trimq_writeβ Current number of entries in trim queue.rebuildq_writeβ Current number of entries in rebuild queue.
π All queue statistics are instantaneous measurements of the number of entries in the queues. If you specify an interval, the measurements will be sampled from the end of the interval.
β¨ EXAMPLES β¨
π Example 13: Adding Cache Devices to a ZFS Pool
The following command adds two disks for use as cache devices to a ZFS storage pool:
# zpool add pool cache sdc sdd
Once added, the cache devices gradually fill with content from main memory. Depending on the size of your cache devices, it could take over an hour for them to fill π. Capacity and reads can be monitored using the iostat subcommand as follows:
# zpool iostat -v pool 5
π Example 16: Adding output columns
Additional columns can be added to the zpool status and zpool iostat output with -c. π
# zpool status -c vendor,model,size
NAME STATE READ WRITE CKSUM vendor model size
tank ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
U1 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
U10 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
U11 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
U12 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
U13 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
U14 ONLINE 0 0 0 SEAGATE ST8000NM0075 7.3T
# zpool iostat -vc size
capacity operations bandwidth
pool alloc free read write read write size
---------- ----- ----- ----- ----- ----- ----- ----
rpool 14.6G 54.9G 4 55 250K 2.69M
sda1 14.6G 54.9G 4 55 250K 2.69M 70G
---------- ----- ----- ----- ----- ----- ----- ----
like??? look at that size column. ate. π₯
π SEE ALSO π
iostat(1), smartctl(8), zpool-list(8), zpool-status(8)
and that's the whole page bestie!! π«Ά this was brought to you by OpenZFS, dated January 29, 2024 β go watch your pools, they're doing great, mwah πβ¨π
π¦ where this page comes from
- alpine 3.23: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- alpine 3.24: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- nixos 26.05: zfs-user 2.4.4
- nixpkgs unstable: zfs-user 2.4.4
- ubuntu stonking: zfsutils-linux 2.4.4-1ubuntu4 Β· CDDL-1.0
- π the page's license: CDDL-1.0
- Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
- Copyright (c) 2012, 2018 by Delphix. All rights reserved
- Copyright (c) 2012 Cyril Plisko. All Rights Reserved
- Copyright (c) 2017 Datto Inc
- Copyright (c) 2018 George Melikov. All Rights Reserved
- Copyright 2017 Nexenta Systems, Inc
- Copyright (c) 2017 Open-E, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms