← All stories
● Covered by 1 source · 1 reportLow impact1 neutral

Turso's io_uring performance improves with application-level readahead

🔄 Updated 1h ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • Turso's io_uring backend uses O_DIRECT, disabling kernel readahead.
  • Application-level readahead was implemented to compensate.
  • Testing showed performance gains with readahead enabled.
  • Readahead increased concurrent I/O and block layer request merging.

Background on Turso's I/O Backends

Turso utilizes two primary I/O backends: one based on the traditional pread(2) syscall and another leveraging io_uring. The io_uring backend opens database files with O_DIRECT, which bypasses the kernel's page cache and, consequently, its readahead mechanism. This necessitates implementing readahead within the application itself to maintain performance for sequential reads.

Implementing Application-Level Readahead

A pull request introduced application-level readahead to Turso's io_uring implementation. Without readahead, the system issues only one I/O request at a time, leading to sequential processing where each read waits for the previous one to complete. With readahead, when sequential access is detected, Turso submits multiple read requests (e.g., 32 pages) concurrently, keeping numerous I/O operations in flight.

Performance Measurement and Results

Performance was evaluated using the TPC-H Q6 benchmark on a 1.2 GiB database, which involves a full scan of the lineitem table. The results indicated that io_uring with application-level readahead was faster. Although readahead caused Turso to submit more SQEs and fetch more data than strictly necessary, the device ultimately received fewer I/O requests due to effective merging.

Impact on Request Merging

The primary benefit of readahead was observed in request merging at the block layer. With readahead off, only 140 out of 195,516 bio requests merged, as there was typically only one SQE in the queue. In contrast, with readahead on, 202,539 out of 218,493 bios merged, resulting in the device receiving only 15,951 requests. This significant increase in merging occurs because multiple concurrent SQEs allow the kernel to combine adjacent requests into larger, more efficient I/O operations.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →

The daily brief

One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.

One email a day. Unsubscribe in one click, any time.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~24 min · 20 stories · Sep 01

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Reporting from

Turso implemented and tested application-level readahead for its io_uring backend, demonstrating significant performance improvements. This change addresses the lack of kernel readahead when using O_DIRECT with io_uring, allowing for concurrent I/O requests and better request merging at the block layer.