]>
git.proxmox.com Git - mirror_zfs-debian.git/blob - scripts/zpios-survey.sh
3 # Wrapper script for easily running a survey of zpios based tests
6 basedir
="$(dirname $0)"
8 SCRIPT_COMMON
=common.sh
9 if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
10 .
"${basedir}/${SCRIPT_COMMON}"
12 echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
20 $0 [hvp] <-c config> <-t test>
23 Helper script for easy zpios survey benchmarking.
29 -c Zpool configuration
37 tee -a ${ZPIOS_SURVEY_LOG} << EOF
39 ================================================================
44 # Baseline performance for an out of the box config with no manual tuning.
45 # Ideally, we want everything to be automatically tuned for your system and
46 # for this to perform reasonably well.
48 TEST_NAME
="${ZPOOL_CONFIG}+${ZPIOS_TEST}+baseline"
49 print_header
${TEST_NAME}
51 ${ZFS_SH} ${VERBOSE_FLAG} | \
52 tee -a ${ZPIOS_SURVEY_LOG}
53 ${ZPIOS_SH} ${VERBOSE_FLAG} -c ${ZPOOL_CONFIG} -t ${ZPIOS_TEST} | \
54 tee -a ${ZPIOS_SURVEY_LOG}
55 ${ZFS_SH} -u ${VERBOSE_FLAG} | \
56 tee -a ${ZPIOS_SURVEY_LOG}
59 # Disable ZFS's prefetching. For some reason still not clear to me
60 # current prefetching policy is quite bad for a random workload.
61 # Allowing the algorithm to detect a random workload and not do
62 # anything may be the way to address this issue.
63 zpios_survey_prefetch
() {
64 TEST_NAME
="${ZPOOL_CONFIG}+${ZPIOS_TEST}+prefetch"
65 print_header
${TEST_NAME}
67 ${ZFS_SH} ${VERBOSE_FLAG} \
68 tee -a ${ZPIOS_SURVEY_LOG}
69 ${ZPIOS_SH} ${VERBOSE_FLAG} -c ${ZPOOL_CONFIG} -t ${ZPIOS_TEST} \
71 tee -a ${ZPIOS_SURVEY_LOG}
72 ${ZFS_SH} -u ${VERBOSE_FLAG} | \
73 tee -a ${ZPIOS_SURVEY_LOG}
76 # Simulating a zerocopy IO path should improve performance by freeing up
77 # lots of CPU which is wasted move data between buffers.
78 zpios_survey_zerocopy
() {
79 TEST_NAME
="${ZPOOL_CONFIG}+${ZPIOS_TEST}+zerocopy"
80 print_header
${TEST_NAME}
82 ${ZFS_SH} ${VERBOSE_FLAG} | \
83 tee -a ${ZPIOS_SURVEY_LOG}
84 ${ZPIOS_SH} ${VERBOSE_FLAG} -c ${ZPOOL_CONFIG} -t ${ZPIOS_TEST} \
86 tee -a ${ZPIOS_SURVEY_LOG}
87 ${ZFS_SH} -u ${VERBOSE_FLAG} | \
88 tee -a ${ZPIOS_SURVEY_LOG}
91 # Disabling checksumming should show some (if small) improvement
92 # simply due to freeing up a modest amount of CPU.
93 zpios_survey_checksum
() {
94 TEST_NAME
="${ZPOOL_CONFIG}+${ZPIOS_TEST}+checksum"
95 print_header
${TEST_NAME}
97 ${ZFS_SH} ${VERBOSE_FLAG} | \
98 tee -a ${ZPIOS_SURVEY_LOG}
99 ${ZPIOS_SH} ${VERBOSE_FLAG} -c ${ZPOOL_CONFIG} -t ${ZPIOS_TEST} \
100 -s "set checksum=off" | \
101 tee -a ${ZPIOS_SURVEY_LOG}
102 ${ZFS_SH} -u ${VERBOSE_FLAG} | \
103 tee -a ${ZPIOS_SURVEY_LOG}
106 # Increasing the pending IO depth also seems to improve things likely
107 # at the expense of latency. This should be explored more because I'm
108 # seeing a much bigger impact there that I would have expected. There
109 # may be some low hanging fruit to be found here.
110 zpios_survey_pending
() {
111 TEST_NAME
="${ZPOOL_CONFIG}+${ZPIOS_TEST}+pending"
112 print_header
${TEST_NAME}
114 ${ZFS_SH} ${VERBOSE_FLAG} \
115 zfs
="zfs_vdev_max_pending=1024" | \
116 tee -a ${ZPIOS_SURVEY_LOG}
117 ${ZPIOS_SH} ${VERBOSE_FLAG} -c ${ZPOOL_CONFIG} -t ${ZPIOS_TEST} | \
118 tee -a ${ZPIOS_SURVEY_LOG}
119 ${ZFS_SH} -u ${VERBOSE_FLAG} | \
120 tee -a ${ZPIOS_SURVEY_LOG}
123 # Apply all possible turning concurrently to get a best case number
125 TEST_NAME
="${ZPOOL_CONFIG}+${ZPIOS_TEST}+all"
126 print_header
${TEST_NAME}
128 ${ZFS_SH} ${VERBOSE_FLAG} \
129 zfs
="zfs_vdev_max_pending=1024" | \
130 tee -a ${ZPIOS_SURVEY_LOG}
131 ${ZPIOS_SH} ${VERBOSE_FLAG} -c ${ZPOOL_CONFIG} -t ${ZPIOS_TEST} \
132 -o "--noprefetch --zerocopy" \
133 -s "set checksum=off" | \
134 tee -a ${ZPIOS_SURVEY_LOG}
135 ${ZFS_SH} -u ${VERBOSE_FLAG} | \
136 tee -a ${ZPIOS_SURVEY_LOG}
141 ZPOOL_NAME
=zpios-survey
142 ZPOOL_CONFIG
=zpool-config.sh
143 ZPIOS_TEST
=zpios-test.sh
144 ZPIOS_SURVEY_LOG
=/dev
/null
146 while getopts 'hvpc:t:l:' OPTION
; do
161 ZPOOL_CONFIG
=${OPTARG}
167 ZPIOS_SURVEY_LOG
=${OPTARG}
176 if [ $
(id
-u) != 0 ]; then
177 die
"Must run as root"
181 zpios_survey_prefetch
182 zpios_survey_zerocopy
183 zpios_survey_checksum