Search code examples
c#asp.net-corekestrel-http-server

Disabling Nagle algorithm in Kestrel Web Server of ASP.Net Core 2.2


KestrelServerOptions.NoDelay is not available in .NET Core 2.2 any more.

Please how can I disable Nagle algorithm in Kestrel Web Server of ASP.Net Core 2.2?


Solution

  • Disabling Nagle's algorithm is now available at ListenOptions.NoDelay

    Here is the code snippet for the same

    .ConfigureKestrel((context, options) =>
    {
        options.Limits.MaxConcurrentConnections = 100;
        options.Listen(IPAddress.Loopback, 5000, (listenOptions =>
        {
            listenOptions.NoDelay = false;
        }));
    });