Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions agent/bench-scripts/drop-cache-example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -x
# drop-cache.sh - an example of a pbench-fio cache-dropping script
# here is an example cache dropping script for Ceph cluster
# it assumes that there is a ceph-ansible inventory file in /root/ansible-hosts
# containing a [osds] host group and a list of Ceph OSD hosts underneath
# the script must be set to be executable using a command like
# chmod 755 drop-cache.sh

ansible -m shell -f 12 -i /root/ansible-hosts -a "sync ; echo 3 > /proc/sys/vm/drop_caches" osds
28 changes: 27 additions & 1 deletion agent/bench-scripts/pbench-fio
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ runtime=""
ramptime=""
iodepth=""
ioengine=""
pre_iteration_script=""
job_mode="concurrent" # serial or concurrent
file_size=""
direct="" # don't cache IO's by default
Expand Down Expand Up @@ -121,6 +122,9 @@ function fio_usage() {
printf "\t\tnumber of jobs to run, if not given then fio default of numjobs=1 will be used\n"
printf -- "\t--job-file=<path>\n"
printf "\t\tprovide the path of a fio job config file, (default is $job_file)\n"
printf -- "\t--pre-iteration-script=str\n"
printf -- "\t\tuse executable script/program to prepare the system for test iteration\n"
printf -- "\t\texample: --pre-iteration-script=\$HOME/drop-cache.sh\n"
printf -- "\t--samples=<int>\n"
printf "\t\tnumber of samples to use per test iteration (default is $nr_samples)\n"
printf -- "\t--max-stddev=<int>\n"
Expand All @@ -133,7 +137,7 @@ function fio_usage() {
}

function fio_process_options() {
opts=$(getopt -q -o jic:t:b:s:d:r: --longoptions "help,max-stddev:,max-failures:,samples:,direct:,sync:,install,clients:,client-file:,iodepth:,ioengine:,config:,jobs-per-dev:,job-mode:,rate-iops:,ramptime:,runtime:,test-types:,block-sizes:,file-size:,targets:,tool-group:,postprocess-only:,run-dir:,directory:,numjobs:,job-file:" -n "getopt.sh" -- "$@");
opts=$(getopt -q -o jic:t:b:s:d:r: --longoptions "help,max-stddev:,max-failures:,samples:,direct:,sync:,install,clients:,client-file:,iodepth:,ioengine:,config:,jobs-per-dev:,job-mode:,rate-iops:,ramptime:,runtime:,test-types:,block-sizes:,file-size:,targets:,tool-group:,postprocess-only:,run-dir:,directory:,numjobs:,job-file:,pre-iteration-script:," -n "getopt.sh" -- "$@");
if [ $? -ne 0 ]; then
printf "\t${benchmark}: you specified an invalid option\n\n"
fio_usage
Expand Down Expand Up @@ -330,6 +334,18 @@ function fio_process_options() {
if [ -n "$1" ]; then
job_file="$1"
shift;

fi
;;
--pre-iteration-script)
shift;
if [ -n "$1" ]; then
pre_iteration_script="$1"
if [ ! -x $pre_iteration_script ]; then
printf "ERROR: $pre_iteration_script must be executable\n"
exit 1
fi
shift;
fi
;;
--)
Expand Down Expand Up @@ -513,6 +529,16 @@ function fio_run_job() {
else
mkdir -p $benchmark_results_dir/clients/localhost
fi

# certain test preparation steps such as cache dropping
# can be a bit hard on the system, give it a few
# seconds before actually starting test
# by putting this before pbench-start-tools,

if [ -n "$pre_iteration_script" ] ; then
printf "running pre-iteration-script command: $pre_iteration_script\n"
eval "$pre_iteration_script"
fi
pbench-start-tools --group=$tool_group --iteration=$iteration --dir=$benchmark_results_dir
local client_opts=""

Expand Down