]> git.proxmox.com Git - mirror_zfs.git/blobdiff - tests/zfs-tests/tests/perf/regression/sequential_reads.ksh
OpenZFS 9082 - Add ZFS performance test targeting ZIL latency
[mirror_zfs.git] / tests / zfs-tests / tests / perf / regression / sequential_reads.ksh
index a9c62fe5a977e3791ef007d98e94c095ea637e6b..93c109e73bbad273d1bf7e6a5b2df4f0537ae150 100755 (executable)
 function cleanup
 {
        # kill fio and iostat
-       pkill ${fio##*/}
-       pkill ${iostat##*/}
-       log_must_busy zfs destroy $TESTFS
-       log_must_busy zpool destroy $PERFPOOL
+       pkill fio
+       pkill iostat
+       recreate_perf_pool
 }
 
 trap "log_fail \"Measure IO stats during random read load\"" SIGTERM
-
-log_assert "Measure IO stats during sequential read load"
 log_onexit cleanup
 
-export TESTFS=$PERFPOOL/testfs
-recreate_perfpool
-log_must zfs create $PERF_FS_OPTS $TESTFS
+recreate_perf_pool
+populate_perf_filesystems
 
 # Aim to fill the pool to 50% capacity while accounting for a 3x compressratio.
-export TOTAL_SIZE=$(($(get_prop avail $TESTFS) * 3 / 2))
+export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2))
 
 # Variables for use by fio.
 if [[ -n $PERF_REGRESSION_WEEKLY ]]; then
        export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_WEEKLY}
        export PERF_RUNTYPE=${PERF_RUNTYPE:-'weekly'}
        export PERF_NTHREADS=${PERF_NTHREADS:-'8 16 32 64'}
+       export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
        export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
        export PERF_IOSIZES=${PERF_IOSIZES:-'64k 128k 1m'}
 elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
        export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
        export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
        export PERF_NTHREADS=${PERF_NTHREADS:-'8 16'}
+       export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
        export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
        export PERF_IOSIZES=${PERF_IOSIZES:-'128k 1m'}
 fi
@@ -79,6 +77,7 @@ fi
 # of the available files.
 export NUMJOBS=$(get_max $PERF_NTHREADS)
 export FILE_SIZE=$((TOTAL_SIZE / NUMJOBS))
+export DIRECTORY=$(get_directory)
 log_must fio $FIO_SCRIPTS/mkfiles.fio
 
 # Set up the scripts and output files that will log performance data.
@@ -88,14 +87,22 @@ if is_linux; then
     typeset perf_record_cmd="perf record -F 99 -a -g -q \
         -o /dev/stdout -- sleep ${PERF_RUNTIME}"
 
-       export collect_scripts=("zpool iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
-           "$PERF_SCRIPTS/prefetch_io.sh $PERFPOOL 1" "prefetch" "vmstat 1"
-           "vmstat" "mpstat  -P ALL 1" "mpstat" "iostat -dxyz 1" "iostat"
-           "$perf_record_cmd" "perf")
+       export collect_scripts=(
+           "zpool iostat -lpvyL $PERFPOOL 1" "zpool.iostat"
+           "$PERF_SCRIPTS/prefetch_io.sh $PERFPOOL 1" "prefetch"
+           "vmstat 1" "vmstat"
+           "mpstat  -P ALL 1" "mpstat"
+           "iostat -dxyz 1" "iostat"
+           "$perf_record_cmd" "perf"
+       )
 else
-       export collect_scripts=("$PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
-           "$PERF_SCRIPTS/prefetch_io.d $PERFPOOL 1" "prefetch" "vmstat 1" "vmstat"
-           "mpstat 1" "mpstat" "iostat -xcnz 1" "iostat")
+       export collect_scripts=(
+           "$PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
+           "$PERF_SCRIPTS/prefetch_io.d $PERFPOOL 1" "prefetch"
+           "vmstat 1" "vmstat"
+           "mpstat 1" "mpstat"
+           "iostat -xcnz 1" "iostat"
+       )
 fi
 
 log_note "Sequential reads with $PERF_RUNTYPE settings"