Created
April 23, 2025 05:59
-
-
Save MrCroxx/8ee5f6d2d4f519a4827f083bfa9f26fb to your computer and use it in GitHub Desktop.
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
| #!/bin/bash | |
| set -ueo pipefail | |
| TEST_DIR=$1 | |
| echo "benchmark disk mounted on" $TEST_DIR | |
| echo "--> write throughput" | |
| sudo fio --name=write_throughput --directory=$TEST_DIR --numjobs=8 \ | |
| --size=10G --time_based --runtime=60s --ramp_time=2s --ioengine=libaio \ | |
| --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=write \ | |
| --group_reporting=1 | |
| echo "--> read throughput" | |
| sudo fio --name=read_throughput --directory=$TEST_DIR --numjobs=8 \ | |
| --size=10G --time_based --runtime=60s --ramp_time=2s --ioengine=libaio \ | |
| --direct=1 --verify=0 --bs=1M --iodepth=64 --rw=read \ | |
| --group_reporting=1 | |
| echo "--> write IOPS" | |
| sudo fio --name=write_iops --directory=$TEST_DIR --size=10G \ | |
| --time_based --runtime=60s --ramp_time=2s --ioengine=libaio --direct=1 \ | |
| --verify=0 --bs=4K --iodepth=256 --rw=randwrite --group_reporting=1 | |
| echo "--> read IOPS" | |
| sudo fio --name=read_iops --directory=$TEST_DIR --size=10G \ | |
| --time_based --runtime=60s --ramp_time=2s --ioengine=libaio --direct=1 \ | |
| --verify=0 --bs=4K --iodepth=256 --rw=randread --group_reporting=1 | |
| echo "--> write latency" | |
| sudo fio --name=write_latency --directory=$TEST_DIR \ | |
| --filesize=10G --time_based --ramp_time=2s --runtime=1m \ | |
| --ioengine=libaio --direct=1 --verify=0 --randrepeat=0 \ | |
| --bs=4K --iodepth=2 --rw=randwrite --group_reporting=1 | |
| echo "--> read latency" | |
| sudo fio --name=read_latency --directory=$TEST_DIR \ | |
| --filesize=10G --time_based --ramp_time=2s --runtime=1m \ | |
| --ioengine=libaio --direct=1 --verify=0 --randrepeat=0 \ | |
| --bs=4K --iodepth=2 --rw=randread --group_reporting=1 | |
| echo "--> fsync" | |
| sudo fio --name=fsync --directory=$TEST_DIR --filesize=10G \ | |
| --time_based --ramp_time=2s --runtime=30s \ | |
| --ioengine=libaio --direct=0 --verify=0 -fdatasync=1 \ | |
| --bs=4K --iodepth=8 --rw=randwrite --group_reporting=1 | |
| echo "--> fsync latency" | |
| sudo fio --name=fsync_latency --directory=$TEST_DIR --filesize=10G \ | |
| --time_based --ramp_time=2s --runtime=30s \ | |
| --ioengine=psync --direct=0 --verify=0 -fdatasync=1 \ | |
| --bs=4K --rw=randwrite --group_reporting=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment