light-speed-io
light-speed-io copied to clipboard
Performance tracking issue (reading from a local SSD)
Ultimate aim: perform at least as well as fio
when reading from a local SSD :slightly_smiling_face:.
Tools
-
Criterion.rs: "a statistics-driven micro-benchmarking tool". Of relevance for light-speed-io, Criterion can be told to do some setup outside of the main benchmarking code (e.g. clearing the Linux page cache); and can record throughput in bytes per second.
- Usage:
-
cargo bench
- Then open
index.html
inlight-speed-io/target/criterion/<GROUP>/<BENCH>/report/index.html
-
- Usage:
-
[cargo-]flamegraph: "A Rust-powered flamegraph generator with additional support for Cargo projects!"
- Setup:
-
cargo install flamegraph
-
sudo apt install linux-tools-common linux-tools-generic linux-tools-
uname -r
-
echo "0" | sudo tee '/proc/sys/kernel/perf_event_paranoid' | sudo tee '/proc/sys/kernel/kptr_restrict'
-
- Usage:
-
cargo flamegraph --bench io_uring_local
-
- Setup:
Benchmark workload
-
load_1000_files
: Each file is 262,144 bytes. Each file was created byfio
. We measure the total time to load all 1,000 files. The Linux page cache is flushed before each run (vmtouch -e </path/to/files/>
).
Plan
- Use the flamegraph to identify hotspots.
- Attempt to optimise those hotspots.
- Measure runtimes with
criterion
. - Repeat until the runtime is comparable to
fio
's runtime!
I'll use milestone 2 to keep track of relevant issues, and to prioritise issues.
fio
configuration
[global]
nrfiles=1000
filesize=256k
direct=1
iodepth=16
ioengine=io_uring
bs=128k
numjobs=1
[reader1]
rw=read
directory=/home/jack/temp/fio