Skip to content

tkp1n/IoUring.Transport

Repository files navigation

IoUring.Transport

Experimental, managed ASP.NET Core Transport layer based on io_uring. This library is inspired by kestrel-linux-transport, a similar linux-specific transport layer based on epoll.

This transport layer supports both server (IConnectionListenerFactory) and client (IConnectionFactory) scenarios.

Setup

Get the latest preview release from NuGet or the last build from master via MyGet.

In the ConfigureServices method of the Startup.cs file of every basic ASP.NET application, add the following:

using IoUring.Transport;
// ...
public void ConfigureServices(IServiceCollection services)
{
    // ...
    services.AddIoUringTransport(); // no-op if OS != Linux or kernel version < 5.4
    // ...
}

Options

Various configuration options are available if needed (the default values are shown):

public void ConfigureServices(IServiceCollection services)
{
    // ...
    services.AddIoUringTransport(options =>
    {
        options.ThreadCount = Environment.ProcessorCount / 2;
        options.SetThreadAffinity = false;
        options.ApplicationSchedulingMode = PipeScheduler.ThreadPool;
        options.TcpNoDelay = true;
        options.RingSize = 128;
        options.ListenBacklog = 128;
    });
    // ...
}

About

io_uring-based Transport for C# / .NET

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages