Skip to content

Zero copy file transferring (via FileRegion) is disabled for IoUring transport. #5743

@doxlik

Description

@doxlik

Hello dear Vert.x team.

As I see, in the IoUringTransport the support of file region is disabled by

public class IoUringTransport implements Transport {
...
  @Override
  public boolean supportFileRegion() {
    return false;
  }
...

which mean that Http1xServerResponse.sendFile function will always fallback to read / write model instead of zero copy.

And as Netty have direct support for file regions over io_uring (via IoUringFileRegion) I think it is good idea to enable this support for Vert.x as well, what do you think?

P.S. I tried to "hack" transport just to make this getter return true (via Unsafe) and IoUringFileRegion start to work BUT it has constant fd leak, actually they were never closed and I thought that probably it is bug of IoUringFileRegion but I check in reactor-netty lib and it utilizing IoUringFileRegion don't have leak which mean my hack was not enough and we also need somewhere handle FileRegion closure / releasing and as you have super huge experience with Netty and DefaultFileRegion I think handling IoUringFileRegion will not cause big problems for you.

Thank you for bringing such perfect software as Vert.x to JVM community)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions