Turso finds io_uring readahead cuts device requests 12x in TPC-H benchmark
A throwaway pull request to add readahead to Turso's io_uring backend became a case study in I/O performance. Without readahead, Turso issues one io_uring read at a time and waits for each to complete before requesting the next page; with a 32-page prefetch window enabled via PRAGMA, it submits many reads concurrently. On a TPC-H full-table scan, this dropped actual device requests from about 196,000 to roughly 16,300, while average request size grew more than tenfold and request-merging jumped from near zero to over 90%.
GoKawiil's interpretation of the reporting above, not reported fact.
Turso's io_uring backend uses O_DIRECT, which bypasses the kernel's built-in readahead, so the database has to reimplement that optimization itself or lose a major performance advantage. The measurements show that concurrency and request coalescing, not the raw speed of io_uring, are what actually make direct I/O competitive, a reminder that bypassing the kernel means taking on its responsibilities too.
- Application-level readahead let Turso batch 32 sequential page reads into overlapping io_uring submissions instead of one at a time.
- Device-level read requests fell from ~196,000 to ~16,300 while average request size rose from 4.37 KiB to 56.53 KiB.
- Read request merging jumped from near 0% to 91-93%, showing the kernel effectively coalescing the batched io_uring submissions.
Samsung 990 PRO NVMe SSD — Deep dives into io_uring, O_DIRECT and readahead depth only pay off when the drive underneath can keep many requests in flight — exactly what a high-queue-depth NVMe SSD like the Samsung 990 PRO is built for. It's a great upgrade for running TPC-H style benchmarks or hosting a local database on your dev machine.
See Samsung 990 PRO NVMe SSD on Amazon → Affiliate link — we may earn a commission on purchases, at no extra cost to you. Product picked by AI based on this article; it is not a tested recommendation.Source: frn.sh, 2026-09-01
Published there as: “Io_uring Without Readahead”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.