Browse Source

aspcore add LinuxTransport (#4211)

* aspcore add LinuxTransport

* Update deps

* Add Libuv package

* Improve docker caching

* Use more common docker tag
Ben Adams 6 years ago
parent
commit
8a644865db
25 changed files with 117 additions and 39 deletions
  1. 5 5
      frameworks/CSharp/aspnetcore/Benchmarks/Benchmarks.csproj
  2. 10 0
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs
  3. 1 0
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/NuGet.Config
  4. 5 3
      frameworks/CSharp/aspnetcore/PlatformBenchmarks/PlatformBenchmarks.csproj
  5. 2 2
      frameworks/CSharp/aspnetcore/aspcore-ado-my.dockerfile
  6. 2 2
      frameworks/CSharp/aspnetcore/aspcore-ado-pg.dockerfile
  7. 2 2
      frameworks/CSharp/aspnetcore/aspcore-mvc-ado-my.dockerfile
  8. 2 2
      frameworks/CSharp/aspnetcore/aspcore-mvc-ado-pg.dockerfile
  9. 2 2
      frameworks/CSharp/aspnetcore/aspcore-mvc-dap-my.dockerfile
  10. 2 2
      frameworks/CSharp/aspnetcore/aspcore-mvc-dap-pg.dockerfile
  11. 2 2
      frameworks/CSharp/aspnetcore/aspcore-mvc-ef-pg.dockerfile
  12. 1 1
      frameworks/CSharp/aspnetcore/aspcore-mvc.dockerfile
  13. 2 2
      frameworks/CSharp/aspnetcore/aspcore-mw-ado-my.dockerfile
  14. 2 2
      frameworks/CSharp/aspnetcore/aspcore-mw-ado-pg.dockerfile
  15. 2 2
      frameworks/CSharp/aspnetcore/aspcore-mw-dap-my.dockerfile
  16. 2 2
      frameworks/CSharp/aspnetcore/aspcore-mw-dap-pg.dockerfile
  17. 2 2
      frameworks/CSharp/aspnetcore/aspcore-mw-ef-pg.dockerfile
  18. 1 1
      frameworks/CSharp/aspnetcore/aspcore-mw-json.dockerfile
  19. 1 1
      frameworks/CSharp/aspnetcore/aspcore-mw-spanjson.dockerfile
  20. 1 1
      frameworks/CSharp/aspnetcore/aspcore-mw-utf8json.dockerfile
  21. 1 1
      frameworks/CSharp/aspnetcore/aspcore-mw.dockerfile
  22. 13 0
      frameworks/CSharp/aspnetcore/aspcore-rhtx-pg.dockerfile
  23. 13 0
      frameworks/CSharp/aspnetcore/aspcore-rhtx.dockerfile
  24. 2 2
      frameworks/CSharp/aspnetcore/aspcore.dockerfile
  25. 39 0
      frameworks/CSharp/aspnetcore/benchmark_config.json

+ 5 - 5
frameworks/CSharp/aspnetcore/Benchmarks/Benchmarks.csproj

@@ -13,11 +13,11 @@
 
   <ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.App" />
-    <PackageReference Include="Dapper" Version="1.50.4" />
-    <PackageReference Include="MySqlConnector" Version="0.44.1" />
-    <PackageReference Include="Npgsql" Version="4.0.2" />
-    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.1.1.1" />
-    <PackageReference Include="SpanJson" Version="1.2.2" />
+    <PackageReference Include="Dapper" Version="1.50.5" />
+    <PackageReference Include="MySqlConnector" Version="0.47.1" />
+    <PackageReference Include="Npgsql" Version="4.0.3" />
+    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.1.2" />
+    <PackageReference Include="SpanJson" Version="1.3.2" />
     <PackageReference Include="Utf8Json" Version="1.3.7" />
   </ItemGroup>
 </Project>

+ 10 - 0
frameworks/CSharp/aspnetcore/PlatformBenchmarks/BenchmarkConfigurationHelpers.cs

@@ -49,6 +49,16 @@ namespace PlatformBenchmarks
                     }
                 });
             }
+            else if (string.Equals(webHost, "LinuxTransport", StringComparison.OrdinalIgnoreCase))
+            {
+                builder.UseLinuxTransport(options =>
+                {
+                    if (theadCount.HasValue)
+                    {
+                        options.ThreadCount = theadCount.Value;
+                    }
+                });
+            }
 
             return builder;
         }

+ 1 - 0
frameworks/CSharp/aspnetcore/PlatformBenchmarks/NuGet.Config

@@ -3,5 +3,6 @@
   <packageSources>
     <clear />
     <add key="NuGet" value="https://api.nuget.org/v3/index.json" />
+    <add key="rh" value="https://www.myget.org/F/redhat-dotnet/api/v3/index.json" />
   </packageSources>
 </configuration>

+ 5 - 3
frameworks/CSharp/aspnetcore/PlatformBenchmarks/PlatformBenchmarks.csproj

@@ -12,9 +12,11 @@
   </ItemGroup>
 
   <ItemGroup>
+    <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv" Version="2.1.3" />
     <PackageReference Include="Utf8Json" Version="1.3.7" />
-    <PackageReference Include="Npgsql" Version="4.0.2" />
-    <PackageReference Include="MySqlConnector" Version="0.44.1" />
-    <PackageReference Include="Microsoft.AspNetCore.All" />
+    <PackageReference Include="Npgsql" Version="4.0.3" />
+    <PackageReference Include="MySqlConnector" Version="0.47.1" />
+    <PackageReference Include="RedHat.AspNetCore.Server.Kestrel.Transport.Linux" Version="2.1.0-*" />
+    <PackageReference Include="Microsoft.AspNetCore.App" />
   </ItemGroup>
 </Project>

+ 2 - 2
frameworks/CSharp/aspnetcore/aspcore-ado-my.dockerfile

@@ -1,13 +1,13 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY PlatformBenchmarks .
 RUN dotnet publish -c Release -o out
-COPY Benchmarks/appsettings.mysql.json ./out/appsettings.json
 
 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
 ENV ASPNETCORE_URLS http://+:8080
 ENV COMPlus_ReadyToRun 0
 WORKDIR /app
 COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.mysql.json ./appsettings.json
 
 ENTRYPOINT ["dotnet", "PlatformBenchmarks.dll"]

+ 2 - 2
frameworks/CSharp/aspnetcore/aspcore-ado-pg.dockerfile

@@ -1,13 +1,13 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY PlatformBenchmarks .
 RUN dotnet publish -c Release -o out
-COPY Benchmarks/appsettings.postgresql.json ./out/appsettings.json
 
 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
 ENV ASPNETCORE_URLS http://+:8080
 ENV COMPlus_ReadyToRun 0
 WORKDIR /app
 COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.postgresql.json ./appsettings.json
 
 ENTRYPOINT ["dotnet", "PlatformBenchmarks.dll"]

+ 2 - 2
frameworks/CSharp/aspnetcore/aspcore-mvc-ado-my.dockerfile

@@ -1,13 +1,13 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out
-COPY Benchmarks/appsettings.mysql.json ./out/appsettings.json
 
 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
 ENV ASPNETCORE_URLS http://+:8080
 ENV COMPlus_ReadyToRun 0
 WORKDIR /app
 COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.mysql.json ./appsettings.json
 
 ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=MvcDbSingleQueryRaw,MvcDbMultiQueryRaw,MvcDbMultiUpdateRaw,MvcDbFortunesRaw"]

+ 2 - 2
frameworks/CSharp/aspnetcore/aspcore-mvc-ado-pg.dockerfile

@@ -1,13 +1,13 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out
-COPY Benchmarks/appsettings.postgresql.json ./out/appsettings.json
 
 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
 ENV ASPNETCORE_URLS http://+:8080
 ENV COMPlus_ReadyToRun 0
 WORKDIR /app
 COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.postgresql.json ./appsettings.json
 
 ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=MvcDbSingleQueryRaw,MvcDbMultiQueryRaw,MvcDbMultiUpdateRaw,MvcDbFortunesRaw"]

+ 2 - 2
frameworks/CSharp/aspnetcore/aspcore-mvc-dap-my.dockerfile

@@ -1,13 +1,13 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out
-COPY Benchmarks/appsettings.mysql.json ./out/appsettings.json
 
 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
 ENV ASPNETCORE_URLS http://+:8080
 ENV COMPlus_ReadyToRun 0
 WORKDIR /app
 COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.mysql.json ./appsettings.json
 
 ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=MvcDbSingleQueryDapper,MvcDbMultiQueryDapper,MvcDbMultiUpdateDapper,MvcDbFortunesDapper"]

+ 2 - 2
frameworks/CSharp/aspnetcore/aspcore-mvc-dap-pg.dockerfile

@@ -1,13 +1,13 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out
-COPY Benchmarks/appsettings.postgresql.json ./out/appsettings.json
 
 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
 ENV ASPNETCORE_URLS http://+:8080
 ENV COMPlus_ReadyToRun 0
 WORKDIR /app
 COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.postgresql.json ./appsettings.json
 
 ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=MvcDbSingleQueryDapper,MvcDbMultiQueryDapper,MvcDbMultiUpdateDapper,MvcDbFortunesDapper"]

+ 2 - 2
frameworks/CSharp/aspnetcore/aspcore-mvc-ef-pg.dockerfile

@@ -1,13 +1,13 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out
-COPY Benchmarks/appsettings.postgresql.json ./out/appsettings.json
 
 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
 ENV ASPNETCORE_URLS http://+:8080
 ENV COMPlus_ReadyToRun 0
 WORKDIR /app
 COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.postgresql.json ./appsettings.json
 
 ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=MvcDbSingleQueryEf,MvcDbMultiQueryEf,MvcDbMultiUpdateEf,MvcDbFortunesEf"]

+ 1 - 1
frameworks/CSharp/aspnetcore/aspcore-mvc.dockerfile

@@ -1,4 +1,4 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out

+ 2 - 2
frameworks/CSharp/aspnetcore/aspcore-mw-ado-my.dockerfile

@@ -1,13 +1,13 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out
-COPY Benchmarks/appsettings.mysql.json ./out/appsettings.json
 
 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
 ENV ASPNETCORE_URLS http://+:8080
 ENV COMPlus_ReadyToRun 0
 WORKDIR /app
 COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.mysql.json ./appsettings.json
 
 ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=DbSingleQueryRaw,DbMultiQueryRaw,DbMultiUpdateRaw,DbFortunesRaw"]

+ 2 - 2
frameworks/CSharp/aspnetcore/aspcore-mw-ado-pg.dockerfile

@@ -1,13 +1,13 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out
-COPY Benchmarks/appsettings.postgresql.json ./out/appsettings.json
 
 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
 ENV ASPNETCORE_URLS http://+:8080
 ENV COMPlus_ReadyToRun 0
 WORKDIR /app
 COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.postgresql.json ./appsettings.json
 
 ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=DbSingleQueryRaw,DbMultiQueryRaw,DbMultiUpdateRaw,DbFortunesRaw"]

+ 2 - 2
frameworks/CSharp/aspnetcore/aspcore-mw-dap-my.dockerfile

@@ -1,13 +1,13 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out
-COPY Benchmarks/appsettings.mysql.json ./out/appsettings.json
 
 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
 ENV ASPNETCORE_URLS http://+:8080
 ENV COMPlus_ReadyToRun 0
 WORKDIR /app
 COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.mysql.json ./appsettings.json
 
 ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=DbSingleQueryDapper,DbMultiQueryDapper,DbMultiUpdateDapper,DbFortunesDapper"]

+ 2 - 2
frameworks/CSharp/aspnetcore/aspcore-mw-dap-pg.dockerfile

@@ -1,13 +1,13 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out
-COPY Benchmarks/appsettings.postgresql.json ./out/appsettings.json
 
 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
 ENV ASPNETCORE_URLS http://+:8080
 ENV COMPlus_ReadyToRun 0
 WORKDIR /app
 COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.postgresql.json ./appsettings.json
 
 ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=DbSingleQueryDapper,DbMultiQueryDapper,DbMultiUpdateDapper,DbFortunesDapper"]

+ 2 - 2
frameworks/CSharp/aspnetcore/aspcore-mw-ef-pg.dockerfile

@@ -1,13 +1,13 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out
-COPY Benchmarks/appsettings.postgresql.json ./out/appsettings.json
 
 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
 ENV ASPNETCORE_URLS http://+:8080
 ENV COMPlus_ReadyToRun 0
 WORKDIR /app
 COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.postgresql.json ./appsettings.json
 
 ENTRYPOINT ["dotnet", "Benchmarks.dll", "scenarios=DbSingleQueryEf,DbMultiQueryEf,DbMultiUpdateEf,DbFortunesEf"]

+ 1 - 1
frameworks/CSharp/aspnetcore/aspcore-mw-json.dockerfile

@@ -1,4 +1,4 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out

+ 1 - 1
frameworks/CSharp/aspnetcore/aspcore-mw-spanjson.dockerfile

@@ -1,4 +1,4 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out

+ 1 - 1
frameworks/CSharp/aspnetcore/aspcore-mw-utf8json.dockerfile

@@ -1,4 +1,4 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out

+ 1 - 1
frameworks/CSharp/aspnetcore/aspcore-mw.dockerfile

@@ -1,4 +1,4 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY Benchmarks .
 RUN dotnet publish -c Release -o out

+ 13 - 0
frameworks/CSharp/aspnetcore/aspcore-rhtx-pg.dockerfile

@@ -0,0 +1,13 @@
+FROM microsoft/dotnet:2.1-sdk AS build
+WORKDIR /app
+COPY PlatformBenchmarks .
+RUN dotnet publish -c Release -o out
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.postgresql.json ./appsettings.json
+
+ENTRYPOINT ["dotnet", "PlatformBenchmarks.dll", "KestrelTransport=LinuxTransport"]

+ 13 - 0
frameworks/CSharp/aspnetcore/aspcore-rhtx.dockerfile

@@ -0,0 +1,13 @@
+FROM microsoft/dotnet:2.1-sdk AS build
+WORKDIR /app
+COPY PlatformBenchmarks .
+RUN dotnet publish -c Release -o out
+
+FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
+ENV ASPNETCORE_URLS http://+:8080
+ENV COMPlus_ReadyToRun 0
+WORKDIR /app
+COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.json ./appsettings.json
+
+ENTRYPOINT ["dotnet", "PlatformBenchmarks.dll", "KestrelTransport=LinuxTransport"]

+ 2 - 2
frameworks/CSharp/aspnetcore/aspcore.dockerfile

@@ -1,13 +1,13 @@
-FROM microsoft/dotnet:2.1-sdk-stretch AS build
+FROM microsoft/dotnet:2.1-sdk AS build
 WORKDIR /app
 COPY PlatformBenchmarks .
 RUN dotnet publish -c Release -o out
-COPY Benchmarks/appsettings.json ./out/appsettings.json
 
 FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
 ENV ASPNETCORE_URLS http://+:8080
 ENV COMPlus_ReadyToRun 0
 WORKDIR /app
 COPY --from=build /app/out ./
+COPY Benchmarks/appsettings.json ./appsettings.json
 
 ENTRYPOINT ["dotnet", "PlatformBenchmarks.dll"]

+ 39 - 0
frameworks/CSharp/aspnetcore/benchmark_config.json

@@ -20,6 +20,25 @@
       "notes": "",
       "versus": "aspcore"
     },
+    "rhtx": {
+      "plaintext_url": "/plaintext",
+      "json_url": "/json",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "None",
+      "framework": "ASP.NET Core",
+      "language": "C#",
+      "orm": "Raw",
+      "platform": ".NET",
+      "flavor": "CoreCLR",
+      "webserver": "Kestrel",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "ASP.NET Core, Red Hat Linux Transport",
+      "notes": "",
+      "versus": "aspcore"
+    },
     "ado-pg": {
       "fortune_url": "/fortunes",
       "db_url": "/db",
@@ -40,6 +59,26 @@
       "notes": "",
       "versus": "aspcore-ado-pg"
     },
+    "rhtx-pg": {
+      "fortune_url": "/fortunes",
+      "db_url": "/db",
+      "update_url": "/updates/queries=",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "Postgres",
+      "framework": "ASP.NET Core",
+      "language": "C#",
+      "orm": "Raw",
+      "platform": ".NET",
+      "flavor": "CoreCLR",
+      "webserver": "Kestrel",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "ASP.NET Core, Red Hat Linux Transport, ADO.NET",
+      "notes": "",
+      "versus": "aspcore-ado-pg"
+    },
     "ado-my": {
       "fortune_url": "/fortunes",
       "db_url": "/db",