-
Notifications
You must be signed in to change notification settings - Fork 52
Enhance fio benchmark to measure latency, IOPs and bandwidth #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2e81304
Switch fio benchmark to use libaio and multiple fiojobs to measure IOPs
echiugoog d854113
Merge branch 'main' of https://github.com/intel/PerfSpect into fiojob
echiugoog 1aa168e
Add in libaio-aarch64 and update fio-aarch64 to support libaio on arm
echiugoog 5923923
remove overly verbose/long debug of fio raw output
echiugoog e094f2c
check for storage benchmark errors earlier to catch conditions like
echiugoog eace668
Add back in diskspace check in storage benchmark, space based on
echiugoog f179c95
Merge branch 'main' into fiojob
harp-intel 15148ca
modernize
harp-intel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1159,41 +1159,92 @@ avx-turbo --min-threads=1 --max-threads=$num_cores_per_socket --test scalar_iadd | |
| StorageBenchmarkScriptName: { | ||
| Name: StorageBenchmarkScriptName, | ||
| ScriptTemplate: ` | ||
| numjobs=1 | ||
| file_size_g=5 | ||
| space_needed_k=$(( (file_size_g + 1) * 1024 * 1024 * numjobs )) # space needed in kilobytes: (file_size_g + 1) GB per job | ||
| ramp_time=5s | ||
| runtime=120s | ||
| ioengine=sync | ||
| test_dir=$(mktemp -d --tmpdir="{{.StorageDir}}") | ||
| numjobs_bw=16 | ||
| file_size_bw_g=1 | ||
| space_needed_bw_k=$(( (file_size_bw_g + 1) * 1024 * 1024 * numjobs_bw )) # space needed in kilobytes: (file_size_bw_g + 1) GB per job | ||
| runtime=30s | ||
|
|
||
| # check if .StorageDir is a directory | ||
| if [[ ! -d "{{.StorageDir}}" ]]; then | ||
| echo "ERROR: {{.StorageDir}} does not exist" | ||
| exit 1 | ||
| echo "ERROR: {{.StorageDir}} does not exist" | ||
| exit 1 | ||
| fi | ||
| # check if .StorageDir is writeable | ||
| if [[ ! -w "{{.StorageDir}}" ]]; then | ||
| echo "ERROR: {{.StorageDir}} is not writeable" | ||
| exit 1 | ||
| echo "ERROR: {{.StorageDir}} is not writeable" | ||
| exit 1 | ||
| fi | ||
| # check if .StorageDir has enough space | ||
| # example output for df -P /tmp: | ||
| # Filesystem 1024-blocks Used Available Capacity Mounted on | ||
| # /dev/sdd 1055762868 196668944 805390452 20% / | ||
| available_space=$(df -P "{{.StorageDir}}" | awk 'NR==2 {print $4}') | ||
| if [[ $available_space -lt $space_needed_k ]]; then | ||
| echo "ERROR: {{.StorageDir}} has ${available_space}K available space. A minimum of ${space_needed_k}K is required to run this benchmark." | ||
| exit 1 | ||
| if [[ $available_space -lt $space_needed_bw_k ]]; then | ||
| echo "ERROR: {{.StorageDir}} has ${available_space}K available space. A minimum of ${space_needed_bw_k}K is required to run the IO bandwidth benchmark job." | ||
| exit 1 | ||
| fi | ||
| # create temporary directory for fio test | ||
| test_dir=$(mktemp -d --tmpdir="{{.StorageDir}}") | ||
|
|
||
| sync | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sync and dropping caches isn't strictly necessary, but are good practice when running storage benchmarks
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Put back in eace668 |
||
| /sbin/sysctl -w vm.drop_caches=3 || true | ||
| # single-threaded read & write bandwidth test | ||
| fio --name=bandwidth --directory=$test_dir --numjobs=$numjobs \ | ||
| --size="$file_size_g"G --time_based --runtime=$runtime --ramp_time=$ramp_time --ioengine=$ioengine \ | ||
| --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=rw \ | ||
| --group_reporting=1 --iodepth_batch_submit=64 \ | ||
| --iodepth_batch_complete_max=64 | ||
|
|
||
| FIO_JOBFILE=$(mktemp $test_dir/fio-job-XXXXXX.fio) | ||
| cat > $FIO_JOBFILE <<EOF | ||
| [global] | ||
| ioengine=libaio | ||
| direct=1 | ||
| size=5G | ||
| ramp_time=5s | ||
| time_based | ||
| create_on_open=1 | ||
| unlink=1 | ||
| directory=$test_dir | ||
|
|
||
| [iodepth_1_bs_4k_rand] | ||
| wait_for_previous | ||
| runtime=${runtime} | ||
| rw=randrw | ||
| iodepth=1 | ||
| blocksize=4k | ||
| iodepth_batch_submit=1 | ||
| iodepth_batch_complete_max=1 | ||
|
|
||
| [iodepth_256_bs_4k_rand] | ||
| wait_for_previous | ||
| runtime=${runtime} | ||
| rw=randrw | ||
| iodepth=256 | ||
| blocksize=4k | ||
| iodepth_batch_submit=256 | ||
| iodepth_batch_complete_max=256 | ||
|
|
||
| [iodepth_1_bs_1M_numjobs_${numjobs_bw}] | ||
| wait_for_previous | ||
| size=${file_size_bw_g}G | ||
| runtime=${runtime} | ||
| rw=readwrite | ||
| iodepth=1 | ||
| iodepth_batch_submit=1 | ||
| iodepth_batch_complete_max=1 | ||
| blocksize=1M | ||
| numjobs=$numjobs_bw | ||
| group_reporting=1 | ||
|
|
||
| [iodepth_64_bs_1M_numjobs_${numjobs_bw}] | ||
| wait_for_previous | ||
| size=${file_size_bw_g}G | ||
| runtime=${runtime} | ||
| rw=readwrite | ||
| iodepth=64 | ||
| iodepth_batch_submit=64 | ||
| iodepth_batch_complete_max=64 | ||
| blocksize=1M | ||
| numjobs=$numjobs_bw | ||
| group_reporting=1 | ||
| EOF | ||
|
|
||
| fio --output-format=json $FIO_JOBFILE | ||
|
|
||
| rm -rf $test_dir | ||
| `, | ||
| Superuser: true, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checks for existing, writeable directory with enough space to run the benchmark were added because these issues were run into by users in the past. Without these, diagnosis of failure to run was difficult.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in eace668