Commit 6d3ee836 authored by Karol Latecki's avatar Karol Latecki Committed by Tomasz Zawadzki
Browse files

test/vhost_perf: allow multiple fio config files



Allow multiple fio config files and fun them sequentially
in loop against provisioned Vhost+VMs setup.
This should decrease total time needed for performance
benchmarks as we can re-use current configuration rather
than provision from scratch for each workload.

Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Change-Id: I0c4e37f0bb9f49f7614c8001d74d72b99470c084
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1899


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 652fe8a2
Loading
Loading
Loading
Loading
+39 −38
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ function usage()
	echo "    --fio-bin=PATH          Path to FIO binary on host.;"
	echo "                            Binary will be copied to VM, static compilation"
	echo "                            of binary is recommended."
	echo "    --fio-job=PATH          Fio config to use for test."
	echo "    --fio-jobs=PATH         Comma separated list of fio config files to use for test."
	echo "    --fio-iterations=INT    Number of times to run specified workload."
	echo "    --vm-memory=INT         Amount of RAM memory (in MB) to pass to a single VM."
	echo "                            Default: 2048 MB"
@@ -151,7 +151,7 @@ while getopts 'xh-:' optchar; do
		case "$OPTARG" in
			help) usage $0 ;;
			fio-bin=*) fio_bin="--fio-bin=${OPTARG#*=}" ;;
			fio-job=*) fio_job="${OPTARG#*=}" ;;
			fio-jobs=*) fio_jobs="${OPTARG#*=}" ;;
			fio-iterations=*) fio_iterations="${OPTARG#*=}" ;;
			vm-memory=*) vm_memory="${OPTARG#*=}" ;;
			vm-image=*) VM_IMAGE="${OPTARG#*=}" ;;
@@ -188,9 +188,8 @@ if [[ -n $custom_cpu_cfg ]]; then
	vhost_master_core="${!vhost_master_core}"
fi

if [[ -z $fio_job ]]; then
	warning "No FIO job specified! Will use default from common directory."
	fio_job="$rootdir/test/vhost/common/fio_jobs/default_integrity.job"
if [[ -z $fio_jobs ]]; then
	error "No FIO job specified!"
fi

trap 'error_exit "${FUNCNAME}" "${LINENO}"' INT ERR
@@ -397,11 +396,12 @@ for vm_num in $used_vms; do
done

# Run FIO traffic
for fio_job in ${fio_jobs//,/ }; do
	fio_job_fname=$(basename $fio_job)
	fio_log_fname="${fio_job_fname%%.*}.log"
	for i in $(seq 1 $fio_iterations); do
	echo "Running FIO iteration $i"
	run_fio $fio_bin --job-file="$fio_job" --out="$VHOST_DIR/fio_results" --json $fio_disks &
		echo "Running FIO iteration $i for $fio_job_fname"
		run_fio $fio_bin --hide-results --job-file="$fio_job" --out="$VHOST_DIR/fio_results" --json $fio_disks &
		fio_pid=$!

		if $host_sar_enable || $vm_sar_enable; then
@@ -436,6 +436,7 @@ for i in $(seq 1 $fio_iterations); do
		mv $VHOST_DIR/fio_results/$fio_log_fname $VHOST_DIR/fio_results/$fio_log_fname.$i
		sleep 1
	done
done

notice "Shutting down virtual machines..."
vm_shutdown_all