2016-08-04 00:26:15 +03:00
|
|
|
#!/bin/ksh
|
|
|
|
|
|
|
|
#
|
|
|
|
# This file and its contents are supplied under the terms of the
|
|
|
|
# Common Development and Distribution License ("CDDL"), version 1.0.
|
|
|
|
# You may only use this file in accordance with the terms of version
|
|
|
|
# 1.0 of the CDDL.
|
|
|
|
#
|
|
|
|
# A full copy of the text of the CDDL should have accompanied this
|
|
|
|
# source. A copy of the CDDL is also available via the Internet at
|
|
|
|
# http://www.illumos.org/license/CDDL.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
2021-07-27 00:47:08 +03:00
|
|
|
# Copyright (c) 2015, 2021 by Delphix. All rights reserved.
|
2016-08-04 00:26:15 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Description:
|
|
|
|
# Trigger fio runs using the random_writes job file. The number of runs and
|
|
|
|
# data collected is determined by the PERF_* variables. See do_fio_run for
|
|
|
|
# details about these variables.
|
|
|
|
#
|
|
|
|
# Prior to each fio run the dataset is recreated, and fio writes new files
|
|
|
|
# into an otherwise empty pool.
|
|
|
|
#
|
OpenZFS 9076 - Adjust perf test concurrency settings
ZFS Performance test concurrency should be lowered for better latency
Work by Stephen Blinick.
Nightly performance runs typically consist of two levels of concurrency;
and both are fairly high.
Since the IO runs are to a ZFS filesystem, within a zpool, which is
based on some variable number of vdev's, the amount of IO driven to each
device is variable. Additionally, different device types (HDD vs SSD,
etc) can generally handle a different amount of concurrent IO before
saturating.
Nevertheless, in practice, it appears that most tests are well past the
concurrency saturation point and therefore both perform with the same
throughput, the maximum of the device. Because the queuedepth to the
device(s) is so high however, the latency is much higher than the best
possible at that throughput, and increases linearly with the increase in
concurrency.
This means that changes in code that impact latency during normal
operation (before saturation) may not be apparent when a large component
of the measured latency is from the IO sitting in a queue to be
serviced. Therefore, changing the concurrency settings is recommended
Authored by: Stephen Blinick <stephen.blinick@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: John Wren Kennedy <jwk404@gmail.com>
Ported-by: John Wren Kennedy <jwk404@gmail.com>
OpenZFS-issue: https://www.illumos.org/issues/9076
OpenZFS-commit: https://github.com/openzfs/openzfs/pull/562
Upstream bug: DLPX-45477
Closes #7302
2018-02-12 02:11:59 +03:00
|
|
|
# Thread/Concurrency settings:
|
|
|
|
# PERF_NTHREADS defines the number of files created in the test filesystem,
|
|
|
|
# as well as the number of threads that will simultaneously drive IO to
|
|
|
|
# those files. The settings chosen are from measurements in the
|
|
|
|
# PerfAutoESX/ZFSPerfESX Environments, selected at concurrency levels that
|
|
|
|
# are at peak throughput but lowest latency. Higher concurrency introduces
|
|
|
|
# queue time latency and would reduce the impact of code-induced performance
|
|
|
|
# regressions.
|
|
|
|
#
|
2016-08-04 00:26:15 +03:00
|
|
|
|
|
|
|
. $STF_SUITE/include/libtest.shlib
|
|
|
|
. $STF_SUITE/tests/perf/perf.shlib
|
|
|
|
|
2022-03-08 15:36:03 +03:00
|
|
|
command -v fio > /dev/null || log_unsupported "fio missing"
|
|
|
|
|
2016-08-04 00:26:15 +03:00
|
|
|
function cleanup
|
|
|
|
{
|
2016-11-29 03:24:47 +03:00
|
|
|
# kill fio and iostat
|
2018-04-10 23:29:55 +03:00
|
|
|
pkill fio
|
|
|
|
pkill iostat
|
|
|
|
recreate_perf_pool
|
2016-08-04 00:26:15 +03:00
|
|
|
}
|
|
|
|
|
2016-11-29 03:24:47 +03:00
|
|
|
trap "log_fail \"Measure IO stats during random read load\"" SIGTERM
|
2016-08-04 00:26:15 +03:00
|
|
|
log_onexit cleanup
|
|
|
|
|
2018-04-10 23:29:55 +03:00
|
|
|
recreate_perf_pool
|
|
|
|
populate_perf_filesystems
|
2016-08-04 00:26:15 +03:00
|
|
|
|
|
|
|
# Aim to fill the pool to 50% capacity while accounting for a 3x compressratio.
|
2018-04-10 23:29:55 +03:00
|
|
|
export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2))
|
2016-08-04 00:26:15 +03:00
|
|
|
|
2021-07-27 00:47:08 +03:00
|
|
|
# Variables specific to this test for use by fio.
|
|
|
|
export PERF_NTHREADS=${PERF_NTHREADS:-'32 128'}
|
|
|
|
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
|
|
|
|
export PERF_IOSIZES=${PERF_IOSIZES:-'8k'}
|
2021-09-22 01:17:36 +03:00
|
|
|
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'0 1'}
|
2016-08-04 00:26:15 +03:00
|
|
|
|
|
|
|
# Set up the scripts and output files that will log performance data.
|
|
|
|
lun_list=$(pool_to_lun_list $PERFPOOL)
|
|
|
|
log_note "Collecting backend IO stats with lun list $lun_list"
|
|
|
|
if is_linux; then
|
2018-05-22 20:51:46 +03:00
|
|
|
typeset perf_record_cmd="perf record -F 99 -a -g -q \
|
|
|
|
-o /dev/stdout -- sleep ${PERF_RUNTIME}"
|
|
|
|
|
2018-04-10 23:29:55 +03:00
|
|
|
export collect_scripts=(
|
|
|
|
"zpool iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
|
2018-06-27 01:30:56 +03:00
|
|
|
"vmstat -t 1" "vmstat"
|
2018-04-10 23:29:55 +03:00
|
|
|
"mpstat -P ALL 1" "mpstat"
|
2018-06-27 01:30:56 +03:00
|
|
|
"iostat -tdxyz 1" "iostat"
|
2018-04-10 23:29:55 +03:00
|
|
|
"$perf_record_cmd" "perf"
|
|
|
|
)
|
2016-08-04 00:26:15 +03:00
|
|
|
else
|
2018-04-10 23:29:55 +03:00
|
|
|
export collect_scripts=(
|
|
|
|
"$PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
|
2018-06-27 01:30:56 +03:00
|
|
|
"vmstat -T d 1" "vmstat"
|
|
|
|
"mpstat -T d 1" "mpstat"
|
|
|
|
"iostat -T d -xcnz 1" "iostat"
|
2018-04-10 23:29:55 +03:00
|
|
|
)
|
2016-08-04 00:26:15 +03:00
|
|
|
fi
|
|
|
|
|
2021-07-27 00:47:08 +03:00
|
|
|
log_note "Random writes with settings: $(print_perf_settings)"
|
2017-04-06 03:18:22 +03:00
|
|
|
do_fio_run random_writes.fio true false
|
2016-08-04 00:26:15 +03:00
|
|
|
log_pass "Measure IO stats during random write load"
|