light-speed-io icon indicating copy to clipboard operation
light-speed-io copied to clipboard

Performance tracking issue (reading from a local SSD)

Open JackKelly opened this issue 6 months ago • 8 comments

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 in light-speed-io/target/criterion/<GROUP>/<BENCH>/report/index.html
  • [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

Benchmark workload

  • load_1000_files: Each file is 262,144 bytes. Each file was created by fio. 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

  1. Use the flamegraph to identify hotspots.
  2. Attempt to optimise those hotspots.
  3. Measure runtimes with criterion.
  4. 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

JackKelly avatar Feb 10 '24 12:02 JackKelly