ZPOOL-IOSTAT(8) | System Manager's Manual | ZPOOL-IOSTAT(8) |
zpool-iostat
—
display logical I/O statistics for ZFS storage
pools
zpool |
iostat [[[-c
SCRIPT]
[-lq ]]|-rw ]
[-T u|d]
[-ghHLnpPvy ]
[pool…|[pool
vdev…]|vdev…]
[interval [count]] |
Displays logical I/O statistics for the given pools/vdevs.
Physical I/O statistics may be observed via
iostat(1). If writes are located nearby,
they may be merged into a single larger operation. Additional I/O may be
generated depending on the level of vdev redundancy. To filter output, you
may pass in a list of pools, a pool and list of vdevs in that pool, or a
list of any vdevs from any pool. If no items are specified, statistics for
every pool in the system are shown. When given an
interval, the statistics are printed every
interval seconds until killed. If
-n
flag is specified the headers are displayed only
once, otherwise they are displayed periodically. If
count is specified, the command exits after
count reports are printed. The first report printed is
always the statistics since boot regardless of whether
interval and count are passed.
However, this behavior can be suppressed with the -y
flag. 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.
-c
[SCRIPT1[,SCRIPT2]…]zpool
iostat
output. Users can run any script found in their
~/.zpool.d directory or from the system
/etc/zfs/zpool.d directory. Script names
containing the slash
(/) character
are not allowed. The default search path can be overridden by setting the
ZPOOL_SCRIPTS_PATH
environment variable. A privileged user can only run
-c
if they have the
ZPOOL_SCRIPTS_AS_ROOT
environment variable set. If a script requires the use of a privileged
command, like smartctl(8), then it's
recommended you allow the user access to it in
/etc/sudoers or add the user to the
/etc/sudoers.d/zfs file.
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:
-T
u|d-g
-H
-L
-n
-p
-P
-L
flag.-r
-v
-y
-w
-l
-q
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.
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
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 ---------- ----- ----- ----- ----- ----- ----- ----
March 16, 2022 | OpenZFS |