Skip to content

Commit 0aa01a9

Browse files
webbnhportante
andauthored
Fio (et al.) postprocessing performance improvements
This change modifies the support in BenchPostprocess.pm to expect timeseries data in the workload hash to be a hash of hashes, using the timestamp as the key instead of an array of hashes. This ensures that each timestamp is unique, and it makes each timestamp's data accessible in constant-time rather than requiring a linear (O(n^2)) search. For large datasets, this results in a dramatic improvement in execution time for producing the aggregate results. Also: * Do not re-write fio job file in post-process only mode * Address code formatting and other code quality issues * Tweak agent/tool-scripts/postprocess unit test script * Limit the number of lines in result.json for fio tests * Remove the reference-result symlink from the process-iteration-samples-0 gold * Add unit test for post-process only with no directory * Add a test which stresses fio-postprocess performance Co-authored-by: Peter Portante <[email protected]>
1 parent 97d8021 commit 0aa01a9

File tree

98 files changed

+7572939
-1031
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+7572939
-1031
lines changed

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,22 @@ __pycache__
33
*.swp
44
unittests.log
55
run-unittests.log
6+
build
67
dist
78
*~
89
????-*.patch
10+
/.env
11+
.DS_Store
912
.npmrc
1013
.yarnrc
11-
*.egg-info
14+
*.egg-info/
1215
.tox
1316
.eggs
17+
pip-wheel-metadata
18+
.idea/
19+
.pytest_cache/
20+
.venv
21+
.vscode
1422
Pipfile
1523
Pipfile.lock
24+
*,cover

agent/bench-scripts/pbench-fio

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ function fio_process_options() {
453453
found=1
454454
break;
455455
fi
456-
done
456+
done
457457
if [[ ${found} -ne 1 ]]; then
458458
error_log "Unsupported --test-types=${test_types} encountered"
459459
usage
@@ -564,8 +564,6 @@ function fio_create_jobfile() {
564564
error_log "Failed to create job file \"${fio_job_file}\""
565565
exit 1
566566
fi
567-
echo "Created the following job file (${fio_job_file}):"
568-
cat ${fio_job_file}
569567
}
570568

571569
function does_wildcard_exist() {
@@ -809,8 +807,17 @@ function fio_run_benchmark() {
809807
fi
810808
if [ -e $iteration_dir ]; then
811809
fio_job_file="$iteration_dir/fio.job"
812-
# ARG 1 2 3 4 5 6 7 8 9 10 11 12 13 14
813-
fio_create_jobfile "$test_type" "$ioengine" "$block_size" "$iodepth" "$direct" "$sync" "$runtime" "$ramptime" "$file_size" "$rate_iops" "$histogram_interval_msec" "$dev" "$fio_job_file" "$numjobs"
810+
local _action=""
811+
if [ "$postprocess_only" = "n" ]; then
812+
_action="Created"
813+
# ARG 1 2 3 4 5 6 7 8 9 10 11 12 13 14
814+
fio_create_jobfile "$test_type" "$ioengine" "$block_size" "$iodepth" "$direct" "$sync" "$runtime" "$ramptime" "$file_size" "$rate_iops" "$histogram_interval_msec" "$dev" "$fio_job_file" "$numjobs"
815+
else
816+
_action="Found"
817+
fi
818+
echo "${_action} the following job file (${fio_job_file}):"
819+
cat ${fio_job_file}
820+
814821
iteration_failed=0
815822
sample_failed=0
816823
for sample in `seq 1 $nr_samples`; do
@@ -824,16 +831,17 @@ function fio_run_benchmark() {
824831
mkdir -p $benchmark_results_dir
825832
fio_run_job "$iteration" "$benchmark_results_dir" "$fio_job_file" "$dev" "$clients"
826833
else
827-
# if we are only postprocessing, then we might have to untar an existing result
828-
pushd $iteration_dir >/dev/null
829-
if [ ! -e sample$sample ]; then
830-
if [ -e sample$sample.tar.xz ]; then
834+
# we are only postprocessing, so we might have to untar an existing result
835+
if [ ! -e $benchmark_results_dir ]; then
836+
if [ -e ${iteration_dir}/sample${sample}.tar.xz ]; then
837+
pushd $iteration_dir >/dev/null
831838
tar Jxf sample$sample.tar.xz && /bin/rm sample$sample.tar.xz
839+
popd >/dev/null
832840
else
833841
echo "sample $sample missing. There should be $nr_samples samples"
842+
break 2
834843
fi
835844
fi
836-
popd >/dev/null
837845
fi
838846
debug_log "post-processing fio result"
839847
echo "$script_path/postprocess/$benchmark-postprocess \"$benchmark_results_dir\" \"$tool_label_pattern\" \"$tool_group\"" >"$benchmark_results_dir/$benchmark-postprocess.cmd"
@@ -847,7 +855,7 @@ function fio_run_benchmark() {
847855
fi
848856
if [ $sample_failed -eq 1 ]; then
849857
# we need all samples to be good, so bust out of testing samples now
850-
break
858+
break 2
851859
fi
852860
done
853861
fi
@@ -859,7 +867,7 @@ function fio_run_benchmark() {
859867
((failures++))
860868
fi
861869
if [ $fail -eq 0 -o $failures -ge $max_failures ]; then
862-
break
870+
break 1
863871
fi
864872
done
865873
let count=$count+1 # now we can move to the next iteration

0 commit comments

Comments
 (0)