-f Use files only, disables block device tests
-S Enable stack tracer (negative performance impact)
-c Only create and populate constrained path
+ -n NFSFILE Use the nfsfile to determine the NFS configuration
-I NUM Number of iterations
-d DIR Use DIR for files and loopback devices
-s SIZE Use vdevs of SIZE (default: 4G)
EOF
}
-while getopts 'hvqxkfScd:s:r:?t:T:u:I:' OPTION; do
+while getopts 'hvqxkfScn:d:s:r:?t:T:u:I:' OPTION; do
case $OPTION in
h)
usage
constrain_path
exit
;;
+ n)
+ nfsfile=$OPTARG
+ [[ -f $nfsfile ]] || fail "Cannot read file: $nfsfile"
+ export NFS=1
+ . "$nfsfile"
+ ;;
d)
FILEDIR="$OPTARG"
;;
readlink
rm
rmdir
+ scp
sed
seq
setenforce
shuf
sleep
sort
+ ssh
stat
strings
su
pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/perf
-dist_pkgdata_DATA = perf.shlib
+dist_pkgdata_SCRIPTS = \
+ nfs-sample.cfg \
+ perf.shlib
SUBDIRS = \
fio \
bs=${BLOCKSIZE}
ioengine=psync
sync=${SYNC_TYPE}
+direct=${DIRECT}
numjobs=${NUMJOBS}
[job]
bssplit=4k/50:8k/30:128k/10:1m/10
ioengine=psync
sync=${SYNC_TYPE}
+direct=${DIRECT}
numjobs=${NUMJOBS}
buffer_compress_percentage=66
buffer_compress_chunk=4096
bs=${BLOCKSIZE}
ioengine=psync
sync=${SYNC_TYPE}
+direct=${DIRECT}
numjobs=${NUMJOBS}
buffer_compress_percentage=66
buffer_compress_chunk=4096
bs=${BLOCKSIZE}
ioengine=psync
sync=${SYNC_TYPE}
+direct=${DIRECT}
numjobs=${NUMJOBS}
filesize=${FILESIZE}
buffer_compress_percentage=66
bs=${BLOCKSIZE}
ioengine=psync
sync=${SYNC_TYPE}
+direct=${DIRECT}
numjobs=${NUMJOBS}
[job]
bs=${BLOCKSIZE}
ioengine=psync
sync=${SYNC_TYPE}
+direct=${DIRECT}
numjobs=${NUMJOBS}
filesize=${FILESIZE}
buffer_compress_percentage=66
--- /dev/null
+#
+# 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.
+#
+
+#
+# Copyright (c) 2016 by Delphix. All rights reserved.
+#
+
+#
+# This file is a sample NFS configuration for the performance tests. To use the
+# performance tests over NFS you must have:
+# - a client machine with fio and sudo installed
+# - passwordless SSH set up from this host
+# for delphix and root users to the client
+# - passwordless sudo for the user on the client
+#
+
+
+# The IP address for the server
+export NFS_SERVER=127.0.0.1
+
+# The IP address for the client
+export NFS_CLIENT=127.0.0.1
+
+# The mountpoint to use inside the client
+export NFS_MOUNT=/var/tmp/nfs
+
+# The user to run the tests as on the client
+export NFS_USER=delphix
+
+# Common NFS client mount options
+export NFS_OPTIONS="-o rw,nosuid,bg,hard,rsize=1048576,wsize=1048576,"
+NFS_OPTIONS+="nointr,timeo=600,proto=tcp,actimeo=0,port=2049"
+
+# illumos NFS client mount options
+# export NFS_OPTIONS="$NFS_OPTIONS,vers=3"
+
+# Linux NFS client mount options
+export NFS_OPTIONS="-t nfs $NFS_OPTIONS,noacl,nfsvers=3"
export BLOCKSIZE=$iosize
sync
+ # When running locally, we want to keep the default behavior of
+ # DIRECT == 0, so only set it when we're running over NFS to
+ # disable client cache for reads.
+ if [[ $NFS -eq 1 ]]; then
+ export DIRECT=1
+ do_setup_nfs $script
+ else
+ export DIRECT=0
+ fi
+
# This will be part of the output filename.
typeset suffix=$(get_suffix $threads $sync $iosize)
typeset outfile="$logbase.fio.$suffix"
# Start the load
- log_must fio --output $outfile $FIO_SCRIPTS/$script
+ if [[ $NFS -eq 1 ]]; then
+ log_must ssh -t $NFS_USER@$NFS_CLIENT "
+ fio --output /tmp/fio.out /tmp/test.fio
+ "
+ log_must scp $NFS_USER@$NFS_CLIENT:/tmp/fio.out $outfile
+ else
+ log_must fio --output $outfile $FIO_SCRIPTS/$script
+ fi
}
#
done
}
+# This function sets NFS mount on the client and make sure all correct
+# permissions are in place
+#
+function do_setup_nfs
+{
+ typeset script=$1
+ zfs set sharenfs=on $TESTFS
+ log_must chmod -R 777 /$TESTFS
+
+ ssh -t $NFS_USER@$NFS_CLIENT "mkdir -m 777 -p $NFS_MOUNT"
+ ssh -t $NFS_USER@$NFS_CLIENT "sudo -S umount $NFS_MOUNT"
+ log_must ssh -t $NFS_USER@$NFS_CLIENT "
+ sudo -S mount $NFS_OPTIONS $NFS_SERVER:/$TESTFS $NFS_MOUNT
+ "
+ #
+ # The variables in the fio script are only available in our current
+ # shell session, so we have to evaluate them here before copying
+ # the resulting script over to the target machine.
+ #
+ export jobnum='$jobnum'
+ while read line; do
+ eval echo "$line"
+ done < $FIO_SCRIPTS/$script > /tmp/test.fio
+ log_must sed -i -e "s%directory.*%directory=$NFS_MOUNT%" /tmp/test.fio
+ log_must scp /tmp/test.fio $NFS_USER@$NFS_CLIENT:/tmp
+ log_must rm /tmp/test.fio
+}
+
#
# This function iterates through the value pairs in $PERF_COLLECT_SCRIPTS.
# The script at index N is launched in the background, with its output
export PERF_IOSIZES=${PERF_IOSIZES:-'8k'}
fi
+# Until the performance tests over NFS can deal with multiple file systems,
+# force the use of only one file system when testing over NFS.
+[[ $NFS -eq 1 ]] && PERF_NTHREADS_PER_FS='0'
+
lun_list=$(pool_to_lun_list $PERFPOOL)
log_note "Collecting backend IO stats with lun list $lun_list"
if is_linux; then