1#!/usr/bin/ksh 2 3# 4# This file and its contents are supplied under the terms of the 5# Common Development and Distribution License ("CDDL"), version 1.0. 6# You may only use this file in accordance with the terms of version 7# 1.0 of the CDDL. 8# 9# A full copy of the text of the CDDL should have accompanied this 10# source. A copy of the CDDL is also available via the Internet at 11# http://www.illumos.org/license/CDDL. 12# 13 14# 15# Copyright (c) 2015, 2016 by Delphix. All rights reserved. 16# 17 18. $STF_SUITE/include/libtest.shlib 19. $STF_SUITE/tests/perf/perf.shlib 20 21function cleanup 22{ 23 # 24 # We're using many filesystems depending on the number of 25 # threads for each test, and there's no good way to get a list 26 # of all the filesystems that should be destroyed on cleanup 27 # (i.e. the list of filesystems used for the last test ran). 28 # Thus, we simply recreate the pool as a way to destroy all 29 # filesystems and leave a fresh pool behind. 30 # 31 recreate_perf_pool 32} 33 34log_onexit cleanup 35 36recreate_perf_pool 37 38# Aim to fill the pool to 50% capacity while accounting for a 3x compressratio. 39export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2)) 40 41if [[ -n $PERF_REGRESSION_WEEKLY ]]; then 42 export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_WEEKLY} 43 export PERF_RUNTYPE=${PERF_RUNTYPE:-'weekly'} 44 export PERF_NTHREADS=${PERF_NTHREADS:-'1 2 4 8 16 32 64 128'} 45 export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0 1'} 46 export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'} 47 export PERF_IOSIZES=${PERF_IOSIZES:-'8k'} 48 49elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then 50 export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY} 51 export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'} 52 export PERF_NTHREADS=${PERF_NTHREADS:-'1 4 16 64'} 53 export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0 1'} 54 export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'} 55 export PERF_IOSIZES=${PERF_IOSIZES:-'8k'} 56fi 57 58lun_list=$(pool_to_lun_list $PERFPOOL) 59log_note "Collecting backend IO stats with lun list $lun_list" 60export collect_scripts=( 61 "kstat zfs:0 1" "kstat" 62 "vmstat -T d 1" "vmstat" 63 "mpstat -T d 1" "mpstat" 64 "iostat -T d -xcnz 1" "iostat" 65 "dtrace -Cs $PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io" 66 "dtrace -s $PERF_SCRIPTS/zil.d $PERFPOOL 1" "zil" 67 "dtrace -s $PERF_SCRIPTS/profile.d" "profile" 68 "dtrace -s $PERF_SCRIPTS/offcpu-profile.d" "offcpu-profile" 69) 70 71log_note "ZIL specific random write workload with $PERF_RUNTYPE settings" 72do_fio_run random_writes.fio true false 73log_pass "Measure IO stats during ZIL specific random write workload" 74