firecracker icon indicating copy to clipboard operation
firecracker copied to clipboard

[Perf] Implement async IO for the block device using io_uring

Open ioanachirca opened this issue 5 years ago • 7 comments

After some more debugging there is no doubt that there are 2 major issues which bring down the overall performance of our block device emulation:

  • serialized block file I/O
  • high guest interrupt rate

Our block device emulation works by sequentially processing guest I/O requests. It will also serialize the latency of each request and this results in very low CPU (host/guest) usage when running fio benchmarks. The Firecracker emulation thread is mostly sleeping/waiting for I/O to complete and fio maxes out 4-5K IOPS. To improve on this we will need to add block async I/O support in Firecracker.

The increased guest interrupt overhead becomes significant only when the Firecracker block device is doing a lot of IOPS (70-80k). That happens only if it is backed by a RAMdisk to minimize latencies. As an improvement we will need to implement virtio driver and device event suppression / interrupt mitigation. I've experimented a bit with this and got a nice performance boost.

The current plan is to use io_uring to parallelize the block I/O operations. The io_uring interface was added in kernel 5.1 so this will be available only when running on host kernels that support io_uring, otherwise the emulation will work serially as before.

ioanachirca avatar Feb 11 '20 15:02 ioanachirca

We're starting to prototype this out now (we'll post some details here once we have some outcomes).

raduweiss avatar Mar 04 '21 15:03 raduweiss

This was released as dev preview in Firecracker v1.0.0 More info in the docs: https://github.com/firecracker-microvm/firecracker/blob/main/docs/api_requests/block-io-engine.md

We'll close this issue once we make the Async block io_engine GA.

alindima avatar Feb 23 '22 08:02 alindima

I think we can close the issue even if it was released as dev preview.

serban300 avatar Feb 24 '22 13:02 serban300

Moved to shipped because released with Firecracker v1.0.0 and not further development is required.

xmarcalx avatar Mar 30 '22 19:03 xmarcalx

Sorry for moving the issue again, moving it back to dev preview because the condition to make such feature GA listed here are not met yet.

xmarcalx avatar Mar 31 '22 11:03 xmarcalx

Still in developer preview, re-opening to indicate this.

JonathanWoollett-Light avatar Dec 11 '23 10:12 JonathanWoollett-Light