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
| $ # Generate 8 MB of random data | |
| $ head -c 8M < /dev/urandom > data.txt | |
| $ # Flush and clear the cache so we get the data from disk | |
| $ sync && echo 3 | sudo tee /proc/sys/vm/drop_caches && cargo script posix_fadvise_test.rs | |
| 3 | |
| Compiling posix_fadvise_test v0.1.0 (file:///home/austin/.cargo/script-cache/file-posix_fadvise_test-8d6a7e80a3131286) | |
| Advised result: HashResult { hash: [173, 168, 157, 204, 185, 126, 165, 177, 195, 111, 94, 179, 252, 59, 25, 169], time: Duration { secs: 0, nanos: 10050785 } } | |
| $ # Comment out the call to advise_willneed, save, flush again and re-run | |
| $ sync && echo 3 | sudo tee /proc/sys/vm/drop_caches && cargo script posix_fadvise_test.rs | |
| 3 |
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=disk_benchmark --directory=$TEST_DIR --numjobs=8 \ | |
| --size=10G --time_based --runtime=60s --ramp_time=2s --ioengine=libaio \ |