]>
Commit | Line | Data |
---|---|---|
7106b236 | 1 | #!/bin/ksh |
93491c4b JWK |
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 | ||
21 | function cleanup | |
22 | { | |
23 | # kill fio and iostat | |
24 | pkill fio | |
25 | pkill iostat | |
26 | ||
27 | # | |
28 | # We're using many filesystems depending on the number of | |
29 | # threads for each test, and there's no good way to get a list | |
30 | # of all the filesystems that should be destroyed on cleanup | |
31 | # (i.e. the list of filesystems used for the last test ran). | |
32 | # Thus, we simply recreate the pool as a way to destroy all | |
33 | # filesystems and leave a fresh pool behind. | |
34 | # | |
35 | recreate_perf_pool | |
36 | } | |
37 | ||
38 | trap "log_fail \"Measure IO stats during random write load\"" SIGTERM | |
39 | log_onexit cleanup | |
40 | ||
41 | recreate_perf_pool | |
42 | ||
43 | # Aim to fill the pool to 50% capacity while accounting for a 3x compressratio. | |
44 | export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2)) | |
45 | ||
46 | if [[ -n $PERF_REGRESSION_WEEKLY ]]; then | |
47 | export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_WEEKLY} | |
48 | export PERF_RUNTYPE=${PERF_RUNTYPE:-'weekly'} | |
49 | export PERF_NTHREADS=${PERF_NTHREADS:-'1 2 4 8 16 32 64 128'} | |
50 | export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0 1'} | |
51 | export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'} | |
52 | export PERF_IOSIZES=${PERF_IOSIZES:-'8k'} | |
53 | ||
54 | elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then | |
55 | export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY} | |
56 | export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'} | |
57 | export PERF_NTHREADS=${PERF_NTHREADS:-'1 4 16 64'} | |
58 | export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0 1'} | |
59 | export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'} | |
60 | export PERF_IOSIZES=${PERF_IOSIZES:-'8k'} | |
61 | fi | |
62 | ||
63 | lun_list=$(pool_to_lun_list $PERFPOOL) | |
64 | log_note "Collecting backend IO stats with lun list $lun_list" | |
65 | if is_linux; then | |
66 | typeset perf_record_cmd="perf record -F 99 -a -g -q \ | |
67 | -o /dev/stdout -- sleep ${PERF_RUNTIME}" | |
68 | ||
69 | export collect_scripts=( | |
70 | "zpool iostat -lpvyL $PERFPOOL 1" "zpool.iostat" | |
71 | "vmstat 1" "vmstat" | |
72 | "mpstat -P ALL 1" "mpstat" | |
73 | "iostat -dxyz 1" "iostat" | |
74 | "$perf_record_cmd" "perf" | |
75 | ) | |
76 | else | |
77 | export collect_scripts=( | |
78 | "kstat zfs:0 1" "kstat" | |
79 | "vmstat -T d 1" "vmstat" | |
80 | "mpstat -T d 1" "mpstat" | |
81 | "iostat -T d -xcnz 1" "iostat" | |
82 | "dtrace -Cs $PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io" | |
83 | "dtrace -s $PERF_SCRIPTS/zil.d $PERFPOOL 1" "zil" | |
84 | "dtrace -s $PERF_SCRIPTS/profile.d" "profile" | |
85 | "dtrace -s $PERF_SCRIPTS/offcpu-profile.d" "offcpu-profile" | |
86 | ) | |
87 | fi | |
88 | log_note "ZIL specific random write workload with $PERF_RUNTYPE settings" | |
89 | do_fio_run random_writes.fio true false | |
90 | log_pass "Measure IO stats during ZIL specific random write workload" |