Browse Source

aspcore rhtx: LinuxTransport: use inline scheduling (#4230)

Tom Deseyn 6 years ago
parent
commit
16b8a2ed98

+ 11 - 1
frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs

@@ -6,7 +6,9 @@ using System.Net;
 using Microsoft.AspNetCore;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Server.Kestrel.Core;
+using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal;
 using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
 
 namespace PlatformBenchmarks
 {
@@ -51,7 +53,15 @@ namespace PlatformBenchmarks
             }
             else if (string.Equals(webHost, "LinuxTransport", StringComparison.OrdinalIgnoreCase))
             {
-                builder.UseLinuxTransport(options =>
+                builder.ConfigureServices(services =>
+                {
+                    services.Configure<KestrelServerOptions>(options =>
+                    {
+                        // Run callbacks on the transport thread
+                        options.ApplicationSchedulingMode = SchedulingMode.Inline;
+                    });
+                })
+                .UseLinuxTransport(options =>
                 {
                     if (theadCount.HasValue)
                     {