From a2eabe1e2c46c05a2082a136831cdc7aa3e093b4 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Tue, 21 Jan 2025 19:10:14 +0100 Subject: [PATCH 01/43] try ... --- scenarios/tls.benchmarks.yml | 30 ++++++++++++++++++- src/BenchmarksApps/TLS/Kestrel/.dockerignore | 30 +++++++++++++++++++ src/BenchmarksApps/TLS/Kestrel/Dockerfile | 29 ++++++++++++++++++ src/BenchmarksApps/TLS/Kestrel/Kestrel.csproj | 3 ++ .../Kestrel/Properties/launchSettings.json | 25 +++++++++++----- 5 files changed, 109 insertions(+), 8 deletions(-) create mode 100644 src/BenchmarksApps/TLS/Kestrel/.dockerignore create mode 100644 src/BenchmarksApps/TLS/Kestrel/Dockerfile diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 276976b14..23de5542a 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -35,6 +35,21 @@ jobs: statsEnabled: false arguments: "--urls https://{{serverAddress}}:{{serverPort}} --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}}" + linuxDockerKestrelServer: + source: + repository: https://github.com/deaglegross/benchmarks.git + branchOrCommit: dmkorolev/idna/openssl-versioning + dockerFile: linuxDockerKestrelServer/src/BenchmarksApps/TLS/Kestrel/Dockerfile + dockerImageName: kestrel + dockerContextDirectory: linuxDockerKestrelServer/src/BenchmarksApps/TLS/Kestrel + port: 8080 + variables: + mTLS: false + tlsRenegotiation: false + certValidationConsoleEnabled: false + statsEnabled: false + arguments: "--urls https://{{serverAddress}}:8080 --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}}" + scenarios: # HTTP.SYS @@ -132,4 +147,17 @@ scenarios: connections: 32 serverScheme: https certPath: https://raw.githubusercontent.com/aspnet/Benchmarks/refs/heads/main/src/BenchmarksApps/TLS/Kestrel/testCert.pfx - certPwd: testPassword \ No newline at end of file + certPwd: testPassword + +# Kestrel in Docker + tls-handshakes-linux-docker: + application: + job: linuxDockerKestrelServer + load: + job: wrk + variables: + path: /hello-world + serverPort: 8080 + presetHeaders: connectionclose + connections: 32 + serverScheme: https \ No newline at end of file diff --git a/src/BenchmarksApps/TLS/Kestrel/.dockerignore b/src/BenchmarksApps/TLS/Kestrel/.dockerignore new file mode 100644 index 000000000..fe1152bdb --- /dev/null +++ b/src/BenchmarksApps/TLS/Kestrel/.dockerignore @@ -0,0 +1,30 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md +!**/.gitignore +!.git/HEAD +!.git/config +!.git/packed-refs +!.git/refs/heads/** \ No newline at end of file diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile b/src/BenchmarksApps/TLS/Kestrel/Dockerfile new file mode 100644 index 000000000..8de4753b7 --- /dev/null +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile @@ -0,0 +1,29 @@ +# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# This stage is used when running from VS in fast mode (Default for Debug configuration) +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base +USER $APP_UID +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + +# This stage is used to build the service project +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["Kestrel.csproj", "."] +RUN dotnet restore "./Kestrel.csproj" +COPY . . +WORKDIR "/src/." +RUN dotnet build "./Kestrel.csproj" -c $BUILD_CONFIGURATION -o /app/build + +# This stage is used to publish the service project to be copied to the final stage +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./Kestrel.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Kestrel.dll"] \ No newline at end of file diff --git a/src/BenchmarksApps/TLS/Kestrel/Kestrel.csproj b/src/BenchmarksApps/TLS/Kestrel/Kestrel.csproj index f1158dd58..da7dedac3 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Kestrel.csproj +++ b/src/BenchmarksApps/TLS/Kestrel/Kestrel.csproj @@ -4,10 +4,13 @@ net9.0 enable enable + Linux + . + diff --git a/src/BenchmarksApps/TLS/Kestrel/Properties/launchSettings.json b/src/BenchmarksApps/TLS/Kestrel/Properties/launchSettings.json index 1c7821006..afc0240db 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Properties/launchSettings.json +++ b/src/BenchmarksApps/TLS/Kestrel/Properties/launchSettings.json @@ -1,15 +1,26 @@ -{ - "$schema": "http://json.schemastore.org/launchsettings.json", +{ "profiles": { "https": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "hello-world", - "applicationUrl": "https://localhost:5000;http://localhost:5001", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:5000;http://localhost:5001" + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/hello-world", + "environmentVariables": { + "ASPNETCORE_HTTPS_PORTS": "8080", + "ASPNETCORE_HTTP_PORTS": "8081" + }, + "publishAllPorts": true, + "useSSL": true } - } -} + }, + "$schema": "http://json.schemastore.org/launchsettings.json" +} \ No newline at end of file From 892033303f59eb0e10787889dd1679434599fe19 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Tue, 21 Jan 2025 21:16:04 +0100 Subject: [PATCH 02/43] correct layout --- scenarios/tls.benchmarks.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 23de5542a..559b3c9ea 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -37,11 +37,12 @@ jobs: linuxDockerKestrelServer: source: - repository: https://github.com/deaglegross/benchmarks.git - branchOrCommit: dmkorolev/idna/openssl-versioning - dockerFile: linuxDockerKestrelServer/src/BenchmarksApps/TLS/Kestrel/Dockerfile + dockerKestrel: + repository: https://github.com/deaglegross/benchmarks.git + branchOrCommit: dmkorolev/idna/openssl-versioning + dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile dockerImageName: kestrel - dockerContextDirectory: linuxDockerKestrelServer/src/BenchmarksApps/TLS/Kestrel + dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel port: 8080 variables: mTLS: false From e55a72708c52204b36b926bb828dbac20270d0d4 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Tue, 21 Jan 2025 21:50:30 +0100 Subject: [PATCH 03/43] sources not source --- scenarios/tls.benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 559b3c9ea..324026c77 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -36,7 +36,7 @@ jobs: arguments: "--urls https://{{serverAddress}}:{{serverPort}} --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}}" linuxDockerKestrelServer: - source: + sources: dockerKestrel: repository: https://github.com/deaglegross/benchmarks.git branchOrCommit: dmkorolev/idna/openssl-versioning From 96bd8f697961d71e4fab1bd69a52a68a3473f09a Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Tue, 21 Jan 2025 22:06:13 +0100 Subject: [PATCH 04/43] typo back --- scenarios/tls.benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 324026c77..559b3c9ea 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -36,7 +36,7 @@ jobs: arguments: "--urls https://{{serverAddress}}:{{serverPort}} --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}}" linuxDockerKestrelServer: - sources: + source: dockerKestrel: repository: https://github.com/deaglegross/benchmarks.git branchOrCommit: dmkorolev/idna/openssl-versioning From c64ee8799965099ed767015862721ab64d38049d Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 00:05:55 +0100 Subject: [PATCH 05/43] try --- scenarios/tls.benchmarks.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 559b3c9ea..7de56ae70 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -36,20 +36,20 @@ jobs: arguments: "--urls https://{{serverAddress}}:{{serverPort}} --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}}" linuxDockerKestrelServer: - source: - dockerKestrel: - repository: https://github.com/deaglegross/benchmarks.git - branchOrCommit: dmkorolev/idna/openssl-versioning - dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile + source: + dockerKestrel: + repository: https://github.com/deaglegross/benchmarks.git + branchOrCommit: dmkorolev/idna/openssl-versioning + dockerFile: src/BenchmarksApps/TLS/Kestrel/Dockerfile dockerImageName: kestrel - dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel - port: 8080 - variables: - mTLS: false - tlsRenegotiation: false - certValidationConsoleEnabled: false - statsEnabled: false - arguments: "--urls https://{{serverAddress}}:8080 --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}}" + dockerContextDirectory: src/BenchmarksApps/TLS/Kestrel + port: 8080 + variables: + mTLS: false + tlsRenegotiation: false + certValidationConsoleEnabled: false + statsEnabled: false + arguments: "--urls https://{{serverAddress}}:8080 --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}}" scenarios: From 051c1fc035dc9f4441310cf93e1133131c1d8acf Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 00:06:46 +0100 Subject: [PATCH 06/43] indent --- scenarios/tls.benchmarks.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 7de56ae70..3e27c2264 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -36,20 +36,20 @@ jobs: arguments: "--urls https://{{serverAddress}}:{{serverPort}} --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}}" linuxDockerKestrelServer: - source: - dockerKestrel: - repository: https://github.com/deaglegross/benchmarks.git - branchOrCommit: dmkorolev/idna/openssl-versioning - dockerFile: src/BenchmarksApps/TLS/Kestrel/Dockerfile - dockerImageName: kestrel - dockerContextDirectory: src/BenchmarksApps/TLS/Kestrel - port: 8080 - variables: - mTLS: false - tlsRenegotiation: false - certValidationConsoleEnabled: false - statsEnabled: false - arguments: "--urls https://{{serverAddress}}:8080 --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}}" + source: + dockerKestrel: + repository: https://github.com/deaglegross/benchmarks.git + branchOrCommit: dmkorolev/idna/openssl-versioning + dockerFile: src/BenchmarksApps/TLS/Kestrel/Dockerfile + dockerImageName: kestrel + dockerContextDirectory: src/BenchmarksApps/TLS/Kestrel + port: 8080 + variables: + mTLS: false + tlsRenegotiation: false + certValidationConsoleEnabled: false + statsEnabled: false + arguments: "--urls https://{{serverAddress}}:8080 --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}}" scenarios: From a4624f9f12043bef4a49b5b37afffe12524f3787 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 00:14:19 +0100 Subject: [PATCH 07/43] rollback --- scenarios/tls.benchmarks.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 3e27c2264..10f9af4bb 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -40,10 +40,10 @@ jobs: dockerKestrel: repository: https://github.com/deaglegross/benchmarks.git branchOrCommit: dmkorolev/idna/openssl-versioning - dockerFile: src/BenchmarksApps/TLS/Kestrel/Dockerfile - dockerImageName: kestrel - dockerContextDirectory: src/BenchmarksApps/TLS/Kestrel - port: 8080 + dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile + dockerImageName: kestrel + dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile + port: 8080 variables: mTLS: false tlsRenegotiation: false From a6ebf50f1c341e63cfdad17cfba1ed8821fc5f01 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 10:34:04 +0100 Subject: [PATCH 08/43] another move indent? --- scenarios/tls.benchmarks.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 10f9af4bb..eaf4d9f8d 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -40,10 +40,10 @@ jobs: dockerKestrel: repository: https://github.com/deaglegross/benchmarks.git branchOrCommit: dmkorolev/idna/openssl-versioning - dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile - dockerImageName: kestrel - dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile - port: 8080 + dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile + dockerImageName: kestrel + dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel + port: 8080 variables: mTLS: false tlsRenegotiation: false From 27de7d92cab17a8b24616883d853e3206383b49b Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 12:10:12 +0100 Subject: [PATCH 09/43] sources --- scenarios/tls.benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index eaf4d9f8d..6873a0436 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -36,7 +36,7 @@ jobs: arguments: "--urls https://{{serverAddress}}:{{serverPort}} --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}}" linuxDockerKestrelServer: - source: + sources: dockerKestrel: repository: https://github.com/deaglegross/benchmarks.git branchOrCommit: dmkorolev/idna/openssl-versioning From 97c91a771ca67714a177c3e17668a8ec0c22535d Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 12:24:55 +0100 Subject: [PATCH 10/43] push push --- src/BenchmarksApps/TLS/Kestrel/Dockerfile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile b/src/BenchmarksApps/TLS/Kestrel/Dockerfile index 8de4753b7..ea84658fe 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Dockerfile +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile @@ -26,4 +26,20 @@ RUN dotnet publish "./Kestrel.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "Kestrel.dll"] \ No newline at end of file + +# Arguments for the app itself +ARG urls="https://0.0.0.0:8080" +ARG mTLS="false" +ARG certValidationConsoleEnabled ="false" +ARG statsEnabled ="false" +ARG tlsRenegotiation ="false" +ENTRYPOINT [ + "dotnet", "Kestrel.dll", + # behavioral args + "--urls", $urls, + "--mTLS", $mTLS, + "--tlsRenegotiation", $tlsRenegotiation, + # debug args + "--certValidationConsoleEnabled", $certValidationConsoleEnabled, + "--statsEnabled", $statsEnabled, +] \ No newline at end of file From 65fc61c3b59fb97510add4261a7dac3dd498c6e0 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 12:26:26 +0100 Subject: [PATCH 11/43] fix docker args --- src/BenchmarksApps/TLS/Kestrel/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile b/src/BenchmarksApps/TLS/Kestrel/Dockerfile index ea84658fe..8acb04d3c 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Dockerfile +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile @@ -28,11 +28,11 @@ WORKDIR /app COPY --from=publish /app/publish . # Arguments for the app itself -ARG urls="https://0.0.0.0:8080" -ARG mTLS="false" -ARG certValidationConsoleEnabled ="false" -ARG statsEnabled ="false" -ARG tlsRenegotiation ="false" +ARG urls=https://0.0.0.0:8080 +ARG mTLS=false +ARG certValidationConsoleEnabled=false +ARG statsEnabled=false +ARG tlsRenegotiation=false ENTRYPOINT [ "dotnet", "Kestrel.dll", # behavioral args From f421171776603cbfae61b3ef4a76d2f70b4686f8 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 12:28:21 +0100 Subject: [PATCH 12/43] multiline --- src/BenchmarksApps/TLS/Kestrel/Dockerfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile b/src/BenchmarksApps/TLS/Kestrel/Dockerfile index 8acb04d3c..b767a9dad 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Dockerfile +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile @@ -33,13 +33,13 @@ ARG mTLS=false ARG certValidationConsoleEnabled=false ARG statsEnabled=false ARG tlsRenegotiation=false -ENTRYPOINT [ - "dotnet", "Kestrel.dll", - # behavioral args - "--urls", $urls, - "--mTLS", $mTLS, - "--tlsRenegotiation", $tlsRenegotiation, - # debug args - "--certValidationConsoleEnabled", $certValidationConsoleEnabled, - "--statsEnabled", $statsEnabled, +ENTRYPOINT [ \ + "dotnet", "Kestrel.dll", \ + # behavioral args + "--urls", $urls, \ + "--mTLS", $mTLS, \ + "--tlsRenegotiation", $tlsRenegotiation, \ + # debug args + "--certValidationConsoleEnabled", $certValidationConsoleEnabled, \ + "--statsEnabled", $statsEnabled \ ] \ No newline at end of file From 2f09ff830da519fcea12e93ece0ecb57aefacbe4 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 13:34:26 +0100 Subject: [PATCH 13/43] properly pass args --- scenarios/tls.benchmarks.yml | 2 +- src/BenchmarksApps/TLS/Kestrel/Kestrel.csproj | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 6873a0436..0d5ddfbc4 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -49,7 +49,7 @@ jobs: tlsRenegotiation: false certValidationConsoleEnabled: false statsEnabled: false - arguments: "--urls https://{{serverAddress}}:8080 --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}}" + arguments: "--urls https://{{serverAddress}}:8080 --build-arg mTLS={{mTLS}} --build-arg certValidationConsoleEnabled={{certValidationConsoleEnabled}} --build-arg statsEnabled={{statsEnabled}} --build-arg tlsRenegotiation={{tlsRenegotiation}}" scenarios: diff --git a/src/BenchmarksApps/TLS/Kestrel/Kestrel.csproj b/src/BenchmarksApps/TLS/Kestrel/Kestrel.csproj index da7dedac3..418d7adf5 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Kestrel.csproj +++ b/src/BenchmarksApps/TLS/Kestrel/Kestrel.csproj @@ -6,6 +6,7 @@ enable Linux . + 1b89f0d2-44eb-4070-94ec-e963a14ec8b0 From e5e8c93d08ddf13ceba516f667491500bc5eb46e Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 13:37:54 +0100 Subject: [PATCH 14/43] urls as build arg --- scenarios/tls.benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 0d5ddfbc4..8432ccaf1 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -49,7 +49,7 @@ jobs: tlsRenegotiation: false certValidationConsoleEnabled: false statsEnabled: false - arguments: "--urls https://{{serverAddress}}:8080 --build-arg mTLS={{mTLS}} --build-arg certValidationConsoleEnabled={{certValidationConsoleEnabled}} --build-arg statsEnabled={{statsEnabled}} --build-arg tlsRenegotiation={{tlsRenegotiation}}" + arguments: "--build-arg urls=https://{{serverAddress}}:8080 --build-arg mTLS={{mTLS}} --build-arg certValidationConsoleEnabled={{certValidationConsoleEnabled}} --build-arg statsEnabled={{statsEnabled}} --build-arg tlsRenegotiation={{tlsRenegotiation}}" scenarios: From a8929e347296c0d494e7209c6e11c8996ca9319d Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 13:43:30 +0100 Subject: [PATCH 15/43] dont override the serevr port --- scenarios/tls.benchmarks.yml | 9 ++++----- src/BenchmarksApps/TLS/Kestrel/Dockerfile | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 8432ccaf1..7a3ab0824 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -1,5 +1,4 @@ imports: - - https://raw.githubusercontent.com/dotnet/crank/main/src/Microsoft.Crank.Jobs.Wrk/wrk.yml - https://raw.githubusercontent.com/dotnet/crank/main/src/Microsoft.Crank.Jobs.Bombardier/bombardier.yml - https://raw.githubusercontent.com/dotnet/crank/main/src/Microsoft.Crank.Jobs.HttpClient/httpclient.yml - https://github.com/aspnet/Benchmarks/blob/main/scenarios/aspnet.profiles.yml?raw=true @@ -59,7 +58,7 @@ scenarios: application: job: httpSysServer load: - job: wrk + job: httpclient variables: path: /hello-world presetHeaders: connectionclose @@ -110,7 +109,7 @@ scenarios: application: job: kestrelServer load: - job: wrk + job: httpclient variables: path: /hello-world presetHeaders: connectionclose @@ -155,10 +154,10 @@ scenarios: application: job: linuxDockerKestrelServer load: - job: wrk + job: httpclient variables: path: /hello-world - serverPort: 8080 + # serverPort: 5000 presetHeaders: connectionclose connections: 32 serverScheme: https \ No newline at end of file diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile b/src/BenchmarksApps/TLS/Kestrel/Dockerfile index b767a9dad..f97a3fcb3 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Dockerfile +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile @@ -28,7 +28,7 @@ WORKDIR /app COPY --from=publish /app/publish . # Arguments for the app itself -ARG urls=https://0.0.0.0:8080 +ARG urls=https://localhost:8080 ARG mTLS=false ARG certValidationConsoleEnabled=false ARG statsEnabled=false From f746fff3a37c7a1d29d7733e9c8fa9aeecd61261 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 14:37:40 +0100 Subject: [PATCH 16/43] any address ! --- src/BenchmarksApps/TLS/Kestrel/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile b/src/BenchmarksApps/TLS/Kestrel/Dockerfile index f97a3fcb3..c2ca3df59 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Dockerfile +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile @@ -28,13 +28,12 @@ WORKDIR /app COPY --from=publish /app/publish . # Arguments for the app itself -ARG urls=https://localhost:8080 +ARG urls=https://0.0.0.0:8080 ARG mTLS=false ARG certValidationConsoleEnabled=false ARG statsEnabled=false ARG tlsRenegotiation=false -ENTRYPOINT [ \ - "dotnet", "Kestrel.dll", \ +ENTRYPOINT [ "dotnet", "Kestrel.dll", \ # behavioral args "--urls", $urls, \ "--mTLS", $mTLS, \ From 40913773f020a0fbde41fd3f9b86012384c1306a Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 20:06:09 +0100 Subject: [PATCH 17/43] ready state text --- scenarios/tls.benchmarks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 7a3ab0824..e44483b53 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -43,6 +43,7 @@ jobs: dockerImageName: kestrel dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel port: 8080 + readyStateText: Application started. variables: mTLS: false tlsRenegotiation: false From 940f683ad33b297e0b5252c68ca1f59f745f5fc6 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 20:11:56 +0100 Subject: [PATCH 18/43] more logs, proper build args, --- scenarios/tls.benchmarks.yml | 12 ++++++------ src/BenchmarksApps/TLS/Kestrel/Dockerfile | 13 ++++++------- src/BenchmarksApps/TLS/Kestrel/Program.cs | 3 ++- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index e44483b53..bc5234cca 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -44,12 +44,12 @@ jobs: dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel port: 8080 readyStateText: Application started. - variables: - mTLS: false - tlsRenegotiation: false - certValidationConsoleEnabled: false - statsEnabled: false - arguments: "--build-arg urls=https://{{serverAddress}}:8080 --build-arg mTLS={{mTLS}} --build-arg certValidationConsoleEnabled={{certValidationConsoleEnabled}} --build-arg statsEnabled={{statsEnabled}} --build-arg tlsRenegotiation={{tlsRenegotiation}}" + buildArguments: + - urls=https://0.0.0.0:8080 + - mTLS=false + - tlsRenegotiation=false + - certValidationConsoleEnabled=false + - statsEnabled=false scenarios: diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile b/src/BenchmarksApps/TLS/Kestrel/Dockerfile index c2ca3df59..baf78464b 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Dockerfile +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile @@ -1,4 +1,9 @@ -# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. +# Arguments for the app itself +ARG urls=https://0.0.0.0:8080 +ARG mTLS=false +ARG certValidationConsoleEnabled=false +ARG statsEnabled=false +ARG tlsRenegotiation=false # This stage is used when running from VS in fast mode (Default for Debug configuration) FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base @@ -27,12 +32,6 @@ FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -# Arguments for the app itself -ARG urls=https://0.0.0.0:8080 -ARG mTLS=false -ARG certValidationConsoleEnabled=false -ARG statsEnabled=false -ARG tlsRenegotiation=false ENTRYPOINT [ "dotnet", "Kestrel.dll", \ # behavioral args "--urls", $urls, \ diff --git a/src/BenchmarksApps/TLS/Kestrel/Program.cs b/src/BenchmarksApps/TLS/Kestrel/Program.cs index 9fa7b8dc9..5b23852d1 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Program.cs +++ b/src/BenchmarksApps/TLS/Kestrel/Program.cs @@ -1,11 +1,12 @@ using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates; -using Microsoft.AspNetCore.Authentication.Certificate; using Microsoft.AspNetCore.Server.HttpSys; using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.Server.Kestrel.Https; +Console.WriteLine("Starting application..."); + var builder = WebApplication.CreateBuilder(args); builder.Logging.ClearProviders(); From 3abe8a7b506824237a9f5db7eea18e2e39fb82e5 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 20:17:49 +0100 Subject: [PATCH 19/43] indents? --- src/BenchmarksApps/TLS/Kestrel/Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile b/src/BenchmarksApps/TLS/Kestrel/Dockerfile index baf78464b..0016b52bb 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Dockerfile +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile @@ -32,12 +32,12 @@ FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT [ "dotnet", "Kestrel.dll", \ +ENTRYPOINT [ "dotnet", "Kestrel.dll", \ # behavioral args - "--urls", $urls, \ - "--mTLS", $mTLS, \ - "--tlsRenegotiation", $tlsRenegotiation, \ + "--urls", $urls, \ + "--mTLS", $mTLS, \ + "--tlsRenegotiation", $tlsRenegotiation, \ # debug args - "--certValidationConsoleEnabled", $certValidationConsoleEnabled, \ - "--statsEnabled", $statsEnabled \ + "--certValidationConsoleEnabled", $certValidationConsoleEnabled, \ + "--statsEnabled", $statsEnabled \ ] \ No newline at end of file From 54c2b81ccc00b00cc6a49482c1d9275dc4df8c9b Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 20:26:35 +0100 Subject: [PATCH 20/43] one line! --- src/BenchmarksApps/TLS/Kestrel/Dockerfile | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile b/src/BenchmarksApps/TLS/Kestrel/Dockerfile index 0016b52bb..7f664f995 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Dockerfile +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile @@ -1,5 +1,6 @@ # Arguments for the app itself ARG urls=https://0.0.0.0:8080 +ENV urlsEnv=$urls ARG mTLS=false ARG certValidationConsoleEnabled=false ARG statsEnabled=false @@ -32,12 +33,15 @@ FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT [ "dotnet", "Kestrel.dll", \ - # behavioral args - "--urls", $urls, \ - "--mTLS", $mTLS, \ - "--tlsRenegotiation", $tlsRenegotiation, \ - # debug args - "--certValidationConsoleEnabled", $certValidationConsoleEnabled, \ - "--statsEnabled", $statsEnabled \ -] \ No newline at end of file +ENTRYPOINT [ "dotnet", "Kestrel.dll", "--urls", $urlsEnv ] + +# ENTRYPOINT [ "dotnet", "Kestrel.dll", \ +# # behavioral args +# #"--urls", $urlsEnv, \ +# "--urls", $urlsEnv \ +# # "--mTLS", $mTLS, \ +# # "--tlsRenegotiation", $tlsRenegotiation, \ +# # # debug args +# # "--certValidationConsoleEnabled", $certValidationConsoleEnabled, \ +# # "--statsEnabled", $statsEnabled \ +# ] \ No newline at end of file From 9376cce406f31c898c1792e919cb533140f71a73 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 22 Jan 2025 20:30:15 +0100 Subject: [PATCH 21/43] just env --- scenarios/tls.benchmarks.yml | 12 ++++++------ src/BenchmarksApps/TLS/Kestrel/Dockerfile | 21 +-------------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index bc5234cca..c0dd267b8 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -44,12 +44,12 @@ jobs: dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel port: 8080 readyStateText: Application started. - buildArguments: - - urls=https://0.0.0.0:8080 - - mTLS=false - - tlsRenegotiation=false - - certValidationConsoleEnabled=false - - statsEnabled=false + environmentVariables: + urls: https://0.0.0.0:8080 + mTLS: false + tlsRenegotiation: false + certValidationConsoleEnabled: false + statsEnabled: false scenarios: diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile b/src/BenchmarksApps/TLS/Kestrel/Dockerfile index 7f664f995..256defcb4 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Dockerfile +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile @@ -1,11 +1,3 @@ -# Arguments for the app itself -ARG urls=https://0.0.0.0:8080 -ENV urlsEnv=$urls -ARG mTLS=false -ARG certValidationConsoleEnabled=false -ARG statsEnabled=false -ARG tlsRenegotiation=false - # This stage is used when running from VS in fast mode (Default for Debug configuration) FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base USER $APP_UID @@ -33,15 +25,4 @@ FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT [ "dotnet", "Kestrel.dll", "--urls", $urlsEnv ] - -# ENTRYPOINT [ "dotnet", "Kestrel.dll", \ -# # behavioral args -# #"--urls", $urlsEnv, \ -# "--urls", $urlsEnv \ -# # "--mTLS", $mTLS, \ -# # "--tlsRenegotiation", $tlsRenegotiation, \ -# # # debug args -# # "--certValidationConsoleEnabled", $certValidationConsoleEnabled, \ -# # "--statsEnabled", $statsEnabled \ -# ] \ No newline at end of file +ENTRYPOINT [ "dotnet", "Kestrel.dll" ] \ No newline at end of file From 7b1096161aad64e9f9b94ecac2aebee20afd8cb6 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 01:14:54 +0100 Subject: [PATCH 22/43] wildcard! --- scenarios/tls.benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index c0dd267b8..ee0c48e04 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -45,7 +45,7 @@ jobs: port: 8080 readyStateText: Application started. environmentVariables: - urls: https://0.0.0.0:8080 + urls: https://*:8080 # any ip, port 8080 mTLS: false tlsRenegotiation: false certValidationConsoleEnabled: false From 9ec8ffd6b3808969f9276338b02cf7025387d039 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 12:04:42 +0100 Subject: [PATCH 23/43] include details in config --- scenarios/tls.benchmarks.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index ee0c48e04..5f8c34f61 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -5,6 +5,7 @@ variables: serverPort: 5000 + dockerServerPort: 8080 jobs: httpSysServer: @@ -42,10 +43,11 @@ jobs: dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile dockerImageName: kestrel dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel - port: 8080 + port: {{dockerServerPort}} readyStateText: Application started. + beforeScript: "openssl version" environmentVariables: - urls: https://*:8080 # any ip, port 8080 + urls: https://*:{{dockerServerPort}} # any ip, port 8080 mTLS: false tlsRenegotiation: false certValidationConsoleEnabled: false @@ -158,7 +160,7 @@ scenarios: job: httpclient variables: path: /hello-world - # serverPort: 5000 + serverPort: {{dockerServerPort}} presetHeaders: connectionclose connections: 32 serverScheme: https \ No newline at end of file From 84cde4f4aca11e26e9a5ca409cb82cc2443b4f38 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 12:06:22 +0100 Subject: [PATCH 24/43] wrap --- scenarios/tls.benchmarks.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 5f8c34f61..94973a277 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -43,11 +43,11 @@ jobs: dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile dockerImageName: kestrel dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel - port: {{dockerServerPort}} + port: "{{dockerServerPort}}" readyStateText: Application started. beforeScript: "openssl version" environmentVariables: - urls: https://*:{{dockerServerPort}} # any ip, port 8080 + urls: "https://*:{{dockerServerPort}}" # any ip, port 8080 mTLS: false tlsRenegotiation: false certValidationConsoleEnabled: false @@ -160,7 +160,7 @@ scenarios: job: httpclient variables: path: /hello-world - serverPort: {{dockerServerPort}} + serverPort: "{{dockerServerPort}}" presetHeaders: connectionclose connections: 32 serverScheme: https \ No newline at end of file From 640cefcad8b3b3645bd85ba5d17c163fd0131453 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 12:15:17 +0100 Subject: [PATCH 25/43] try again --- scenarios/tls.benchmarks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 94973a277..09b623dbd 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -43,7 +43,7 @@ jobs: dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile dockerImageName: kestrel dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel - port: "{{dockerServerPort}}" + port: $(dockerServerPort) readyStateText: Application started. beforeScript: "openssl version" environmentVariables: @@ -160,7 +160,7 @@ scenarios: job: httpclient variables: path: /hello-world - serverPort: "{{dockerServerPort}}" + serverPort: $(dockerServerPort) presetHeaders: connectionclose connections: 32 serverScheme: https \ No newline at end of file From 8f380600bc04b9efca44cf32a50e82f435387143 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 12:17:09 +0100 Subject: [PATCH 26/43] just explicitly --- scenarios/tls.benchmarks.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 09b623dbd..1ef328f79 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -5,7 +5,6 @@ variables: serverPort: 5000 - dockerServerPort: 8080 jobs: httpSysServer: @@ -43,11 +42,11 @@ jobs: dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile dockerImageName: kestrel dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel - port: $(dockerServerPort) + port: 8080 readyStateText: Application started. beforeScript: "openssl version" environmentVariables: - urls: "https://*:{{dockerServerPort}}" # any ip, port 8080 + urls: "https://*:8080" # any ip, port 8080 mTLS: false tlsRenegotiation: false certValidationConsoleEnabled: false @@ -160,7 +159,7 @@ scenarios: job: httpclient variables: path: /hello-world - serverPort: $(dockerServerPort) + serverPort: 8080 presetHeaders: connectionclose connections: 32 serverScheme: https \ No newline at end of file From 1907ca72cbfaab4d46edb77200bb76cd74b46618 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 14:48:54 +0100 Subject: [PATCH 27/43] openssl 111 support fofr scenario --- scenarios/tls.benchmarks.yml | 24 ++++++++-- .../{Dockerfile => Dockerfile.default} | 2 +- .../TLS/Kestrel/Dockerfile.openssl111 | 45 +++++++++++++++++++ 3 files changed, 66 insertions(+), 5 deletions(-) rename src/BenchmarksApps/TLS/Kestrel/{Dockerfile => Dockerfile.default} (98%) create mode 100644 src/BenchmarksApps/TLS/Kestrel/Dockerfile.openssl111 diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 1ef328f79..4d09bd182 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -34,12 +34,12 @@ jobs: statsEnabled: false arguments: "--urls https://{{serverAddress}}:{{serverPort}} --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}}" - linuxDockerKestrelServer: + dockerLinuxKestrelServer: sources: dockerKestrel: repository: https://github.com/deaglegross/benchmarks.git branchOrCommit: dmkorolev/idna/openssl-versioning - dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile + dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile.default dockerImageName: kestrel dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel port: 8080 @@ -50,7 +50,7 @@ jobs: mTLS: false tlsRenegotiation: false certValidationConsoleEnabled: false - statsEnabled: false + statsEnabled: false scenarios: @@ -152,9 +152,25 @@ scenarios: certPwd: testPassword # Kestrel in Docker - tls-handshakes-linux-docker: + tls-handshakes-docker-openssl-default: + application: + job: linuxDockerKestrelServer + variables: + dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile.default + load: + job: httpclient + variables: + path: /hello-world + serverPort: 8080 + presetHeaders: connectionclose + connections: 32 + serverScheme: https + + tls-handshakes-docker-openssl-111: application: job: linuxDockerKestrelServer + variables: + dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile.openssl111 load: job: httpclient variables: diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile b/src/BenchmarksApps/TLS/Kestrel/Dockerfile.default similarity index 98% rename from src/BenchmarksApps/TLS/Kestrel/Dockerfile rename to src/BenchmarksApps/TLS/Kestrel/Dockerfile.default index 256defcb4..ffc9706cd 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Dockerfile +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile.default @@ -1,6 +1,6 @@ # This stage is used when running from VS in fast mode (Default for Debug configuration) FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base -USER $APP_UID +USER root WORKDIR /app EXPOSE 8080 EXPOSE 8081 diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile.openssl111 b/src/BenchmarksApps/TLS/Kestrel/Dockerfile.openssl111 new file mode 100644 index 000000000..356668acd --- /dev/null +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile.openssl111 @@ -0,0 +1,45 @@ +# This stage is used when running from VS in fast mode (Default for Debug configuration) +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base +USER root +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + +# install wget to download openssl +RUN apt-get update && apt-get install -y wget +# install perl as openssl dependency +RUN apt-get update && apt-get install -y perl +# install build-essential to get make and other build tools +RUN apt-get update && apt-get install -y build-essential + +# install openssl 1.1.1 +RUN wget -O - https://www.openssl.org/source/openssl-1.1.1w.tar.gz | tar zxf -; \ + cd openssl-1.1.1w; \ + ./config; \ + make install_sw; \ + ldconfig + +# Update PATH to prioritize the newly installed OpenSSL 1.1.1 +ENV PATH="/usr/local/bin:$PATH" + +# This stage is used to build the service project +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["Kestrel.csproj", "."] +RUN dotnet restore "./Kestrel.csproj" +COPY . . +WORKDIR "/src/." +RUN dotnet build "./Kestrel.csproj" -c $BUILD_CONFIGURATION -o /app/build + +# This stage is used to publish the service project to be copied to the final stage +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./Kestrel.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . + +ENTRYPOINT [ "dotnet", "Kestrel.dll" ] \ No newline at end of file From 3694e67ce5b5030291fa8b53788aab26a32cefdb Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 14:49:34 +0100 Subject: [PATCH 28/43] fix naming --- scenarios/tls.benchmarks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 4d09bd182..691267fca 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -154,7 +154,7 @@ scenarios: # Kestrel in Docker tls-handshakes-docker-openssl-default: application: - job: linuxDockerKestrelServer + job: dockerLinuxKestrelServer variables: dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile.default load: @@ -168,7 +168,7 @@ scenarios: tls-handshakes-docker-openssl-111: application: - job: linuxDockerKestrelServer + job: dockerLinuxKestrelServer variables: dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile.openssl111 load: From 5814aa78f824f439b2e7a1f13a5680d0cddba671 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 14:52:38 +0100 Subject: [PATCH 29/43] overriden by job --- scenarios/tls.benchmarks.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 691267fca..e86e98def 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -39,7 +39,7 @@ jobs: dockerKestrel: repository: https://github.com/deaglegross/benchmarks.git branchOrCommit: dmkorolev/idna/openssl-versioning - dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile.default + dockerFile: # provided by job dockerImageName: kestrel dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel port: 8080 @@ -169,8 +169,7 @@ scenarios: tls-handshakes-docker-openssl-111: application: job: dockerLinuxKestrelServer - variables: - dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile.openssl111 + dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile.openssl111 load: job: httpclient variables: From d0e0e561ace5cea4a3fd9afcc196c2a885931a97 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 17:17:39 +0100 Subject: [PATCH 30/43] base on alpine! --- scenarios/tls.benchmarks.yml | 18 +++++--- .../{Dockerfile.default => Dockerfile} | 12 ++++- .../TLS/Kestrel/Dockerfile.openssl111 | 45 ------------------- 3 files changed, 24 insertions(+), 51 deletions(-) rename src/BenchmarksApps/TLS/Kestrel/{Dockerfile.default => Dockerfile} (62%) delete mode 100644 src/BenchmarksApps/TLS/Kestrel/Dockerfile.openssl111 diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index e86e98def..11ca12d30 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -39,7 +39,7 @@ jobs: dockerKestrel: repository: https://github.com/deaglegross/benchmarks.git branchOrCommit: dmkorolev/idna/openssl-versioning - dockerFile: # provided by job + dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile dockerImageName: kestrel dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel port: 8080 @@ -152,11 +152,15 @@ scenarios: certPwd: testPassword # Kestrel in Docker - tls-handshakes-docker-openssl-default: + tls-handshakes-docker-openssl-332: application: job: dockerLinuxKestrelServer - variables: - dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile.default + dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile.default + buildArguments: + # openssl version to install + - OPENSSL_VERSION="3.3.2-r4" + # lookup for openssl+branch version here https://pkgs.alpinelinux.org/packages?name=openssl&branch=v3.20&repo=&arch=x86_64 + - ALPINE_BRANCH="v3.21" load: job: httpclient variables: @@ -169,7 +173,11 @@ scenarios: tls-handshakes-docker-openssl-111: application: job: dockerLinuxKestrelServer - dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile.openssl111 + buildArguments: + # openssl version to install + - OPENSSL_VERSION="1.1.1w-r1" + # lookup for openssl+branch version here https://pkgs.alpinelinux.org/packages?name=openssl&branch=v3.20&repo=&arch=x86_64 + - ALPINE_BRANCH="v3.16" load: job: httpclient variables: diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile.default b/src/BenchmarksApps/TLS/Kestrel/Dockerfile similarity index 62% rename from src/BenchmarksApps/TLS/Kestrel/Dockerfile.default rename to src/BenchmarksApps/TLS/Kestrel/Dockerfile index ffc9706cd..cc0477592 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Dockerfile.default +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile @@ -1,10 +1,20 @@ # This stage is used when running from VS in fast mode (Default for Debug configuration) -FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS base USER root WORKDIR /app EXPOSE 8080 EXPOSE 8081 +# Define a build argument for the OpenSSL version +# lookup for openssl+branch version here https://pkgs.alpinelinux.org/packages?name=openssl&branch=v3.20&repo=&arch=x86_64 +ARG OPENSSL_VERSION=1.1.1w-r1 +ARG ALPINE_BRANCH=v3.16 + +# Add the specified Alpine branch repository and install OpenSSL +RUN echo "http://dl-cdn.alpinelinux.org/alpine/${ALPINE_BRANCH}/main" >> /etc/apk/repositories && \ + apk add --no-cache openssl=${OPENSSL_VERSION} wget perl build-base && \ + rm -rf /var/lib/apt/lists/* + # This stage is used to build the service project FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build ARG BUILD_CONFIGURATION=Release diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile.openssl111 b/src/BenchmarksApps/TLS/Kestrel/Dockerfile.openssl111 deleted file mode 100644 index 356668acd..000000000 --- a/src/BenchmarksApps/TLS/Kestrel/Dockerfile.openssl111 +++ /dev/null @@ -1,45 +0,0 @@ -# This stage is used when running from VS in fast mode (Default for Debug configuration) -FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base -USER root -WORKDIR /app -EXPOSE 8080 -EXPOSE 8081 - -# install wget to download openssl -RUN apt-get update && apt-get install -y wget -# install perl as openssl dependency -RUN apt-get update && apt-get install -y perl -# install build-essential to get make and other build tools -RUN apt-get update && apt-get install -y build-essential - -# install openssl 1.1.1 -RUN wget -O - https://www.openssl.org/source/openssl-1.1.1w.tar.gz | tar zxf -; \ - cd openssl-1.1.1w; \ - ./config; \ - make install_sw; \ - ldconfig - -# Update PATH to prioritize the newly installed OpenSSL 1.1.1 -ENV PATH="/usr/local/bin:$PATH" - -# This stage is used to build the service project -FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build -ARG BUILD_CONFIGURATION=Release -WORKDIR /src -COPY ["Kestrel.csproj", "."] -RUN dotnet restore "./Kestrel.csproj" -COPY . . -WORKDIR "/src/." -RUN dotnet build "./Kestrel.csproj" -c $BUILD_CONFIGURATION -o /app/build - -# This stage is used to publish the service project to be copied to the final stage -FROM build AS publish -ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./Kestrel.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false - -# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . - -ENTRYPOINT [ "dotnet", "Kestrel.dll" ] \ No newline at end of file From 8b7494f917bbe20ce2afa7c04a134008f8ebc28d Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 17:22:46 +0100 Subject: [PATCH 31/43] fix path --- scenarios/tls.benchmarks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 11ca12d30..898ba742f 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -155,7 +155,6 @@ scenarios: tls-handshakes-docker-openssl-332: application: job: dockerLinuxKestrelServer - dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile.default buildArguments: # openssl version to install - OPENSSL_VERSION="3.3.2-r4" From a164a2cabf110ff27f3b325d6eda43f1a3ed5d12 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 17:25:10 +0100 Subject: [PATCH 32/43] sdk alpine --- src/BenchmarksApps/TLS/Kestrel/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BenchmarksApps/TLS/Kestrel/Dockerfile b/src/BenchmarksApps/TLS/Kestrel/Dockerfile index cc0477592..3be617b54 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Dockerfile +++ b/src/BenchmarksApps/TLS/Kestrel/Dockerfile @@ -16,7 +16,7 @@ RUN echo "http://dl-cdn.alpinelinux.org/alpine/${ALPINE_BRANCH}/main" >> /etc/ap rm -rf /var/lib/apt/lists/* # This stage is used to build the service project -FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["Kestrel.csproj", "."] From 04c736be13ec5b7d659eb4c4d84cef2afb0c02c9 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 17:31:59 +0100 Subject: [PATCH 33/43] just try --- scenarios/tls.benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 898ba742f..6f29056cc 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -40,7 +40,7 @@ jobs: repository: https://github.com/deaglegross/benchmarks.git branchOrCommit: dmkorolev/idna/openssl-versioning dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile - dockerImageName: kestrel + dockerImageName: dockerKestrel dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel port: 8080 readyStateText: Application started. From 7b67fca04070dd128d7acdf9d7d9d2a02cee03b3 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 17:42:39 +0100 Subject: [PATCH 34/43] maybe log from app itself? --- src/BenchmarksApps/TLS/Kestrel/Program.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/BenchmarksApps/TLS/Kestrel/Program.cs b/src/BenchmarksApps/TLS/Kestrel/Program.cs index 5b23852d1..14d51c4fa 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Program.cs +++ b/src/BenchmarksApps/TLS/Kestrel/Program.cs @@ -1,3 +1,4 @@ +using System.Diagnostics; using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates; @@ -7,6 +8,18 @@ Console.WriteLine("Starting application..."); +ProcessStartInfo startInfo = new ProcessStartInfo() +{ + FileName = "/bin/bash", + Arguments = "openssl version", + RedirectStandardOutput = true, + RedirectStandardError = true, +}; +Process process = new Process() { StartInfo = startInfo, }; +string output = process.StandardOutput.ReadToEnd(); +process.WaitForExit(); +Console.WriteLine(output); + var builder = WebApplication.CreateBuilder(args); builder.Logging.ClearProviders(); From d63ff37eb82477714c05720c0291573456a06d20 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 17:44:16 +0100 Subject: [PATCH 35/43] try --- src/BenchmarksApps/TLS/Kestrel/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BenchmarksApps/TLS/Kestrel/Program.cs b/src/BenchmarksApps/TLS/Kestrel/Program.cs index 14d51c4fa..0770e2404 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Program.cs +++ b/src/BenchmarksApps/TLS/Kestrel/Program.cs @@ -8,14 +8,14 @@ Console.WriteLine("Starting application..."); -ProcessStartInfo startInfo = new ProcessStartInfo() +ProcessStartInfo processInfo = new ProcessStartInfo() { FileName = "/bin/bash", Arguments = "openssl version", RedirectStandardOutput = true, RedirectStandardError = true, }; -Process process = new Process() { StartInfo = startInfo, }; +using Process process = Process.Start(processInfo)!; string output = process.StandardOutput.ReadToEnd(); process.WaitForExit(); Console.WriteLine(output); From 8765f4e3abce099099232b267006069eb8704048 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 17:45:39 +0100 Subject: [PATCH 36/43] qwe --- src/BenchmarksApps/TLS/Kestrel/Program.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/BenchmarksApps/TLS/Kestrel/Program.cs b/src/BenchmarksApps/TLS/Kestrel/Program.cs index 0770e2404..c5199ae89 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Program.cs +++ b/src/BenchmarksApps/TLS/Kestrel/Program.cs @@ -8,10 +8,8 @@ Console.WriteLine("Starting application..."); -ProcessStartInfo processInfo = new ProcessStartInfo() +ProcessStartInfo processInfo = new ProcessStartInfo("/bin/bash", "openssl version") { - FileName = "/bin/bash", - Arguments = "openssl version", RedirectStandardOutput = true, RedirectStandardError = true, }; From 4506c30b35696ec0e91373ca06fc3fc886b4c314 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 17:53:16 +0100 Subject: [PATCH 37/43] dont do crazy stuff --- src/BenchmarksApps/TLS/Kestrel/Program.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/BenchmarksApps/TLS/Kestrel/Program.cs b/src/BenchmarksApps/TLS/Kestrel/Program.cs index c5199ae89..1697197f2 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Program.cs +++ b/src/BenchmarksApps/TLS/Kestrel/Program.cs @@ -8,16 +8,6 @@ Console.WriteLine("Starting application..."); -ProcessStartInfo processInfo = new ProcessStartInfo("/bin/bash", "openssl version") -{ - RedirectStandardOutput = true, - RedirectStandardError = true, -}; -using Process process = Process.Start(processInfo)!; -string output = process.StandardOutput.ReadToEnd(); -process.WaitForExit(); -Console.WriteLine(output); - var builder = WebApplication.CreateBuilder(args); builder.Logging.ClearProviders(); From b53e58bc96a31d9f97b4ea39f69783a942a2d74c Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 18:05:34 +0100 Subject: [PATCH 38/43] logs! --- src/BenchmarksApps/TLS/Kestrel/Program.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/BenchmarksApps/TLS/Kestrel/Program.cs b/src/BenchmarksApps/TLS/Kestrel/Program.cs index 1697197f2..0132fc525 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Program.cs +++ b/src/BenchmarksApps/TLS/Kestrel/Program.cs @@ -8,6 +8,25 @@ Console.WriteLine("Starting application..."); +using var process = new Process() +{ + StartInfo = + { + FileName = "/usr/bin/env", + Arguments = "openssl version", + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + CreateNoWindow = true, + }, + EnableRaisingEvents = true, +}; + +process.Start(); +process.WaitForExit(); +string output = process.StandardOutput.ReadToEnd(); +Console.WriteLine("In app openssl version: \n" + output + "\n\n"); + var builder = WebApplication.CreateBuilder(args); builder.Logging.ClearProviders(); From 1af4f507ae741c2e60e48b32b5d15c870ca41e5d Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 18:11:36 +0100 Subject: [PATCH 39/43] wrap in function + include openssl 3.0.15 comparison --- scenarios/tls.benchmarks.yml | 17 ++++++++++ src/BenchmarksApps/TLS/Kestrel/Program.cs | 41 ++++++++++++----------- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 6f29056cc..68c46f8de 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -177,6 +177,23 @@ scenarios: - OPENSSL_VERSION="1.1.1w-r1" # lookup for openssl+branch version here https://pkgs.alpinelinux.org/packages?name=openssl&branch=v3.20&repo=&arch=x86_64 - ALPINE_BRANCH="v3.16" + load: + job: httpclient + variables: + path: /hello-world + serverPort: 8080 + presetHeaders: connectionclose + connections: 32 + serverScheme: https + + tls-handshakes-docker-openssl-3015: + application: + job: dockerLinuxKestrelServer + buildArguments: + # openssl version to install + - OPENSSL_VERSION="3.0.15-r1" + # lookup for openssl+branch version here https://pkgs.alpinelinux.org/packages?name=openssl&branch=v3.20&repo=&arch=x86_64 + - ALPINE_BRANCH="v3.17" load: job: httpclient variables: diff --git a/src/BenchmarksApps/TLS/Kestrel/Program.cs b/src/BenchmarksApps/TLS/Kestrel/Program.cs index 0132fc525..4140eb221 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Program.cs +++ b/src/BenchmarksApps/TLS/Kestrel/Program.cs @@ -8,25 +8,6 @@ Console.WriteLine("Starting application..."); -using var process = new Process() -{ - StartInfo = - { - FileName = "/usr/bin/env", - Arguments = "openssl version", - RedirectStandardOutput = true, - RedirectStandardError = true, - UseShellExecute = false, - CreateNoWindow = true, - }, - EnableRaisingEvents = true, -}; - -process.Start(); -process.WaitForExit(); -string output = process.StandardOutput.ReadToEnd(); -Console.WriteLine("In app openssl version: \n" + output + "\n\n"); - var builder = WebApplication.CreateBuilder(args); builder.Logging.ClearProviders(); @@ -142,6 +123,7 @@ bool AllowAnyCertificateValidationWithLogging(X509Certificate2 certificate, X509 await app.StartAsync(); Console.WriteLine("Application Info:"); +LogOpenSSLVersion(); if (mTlsEnabled) { Console.WriteLine($"\tmTLS is enabled (client cert is required)"); @@ -178,4 +160,25 @@ static IPEndPoint CreateIPEndPoint(UrlPrefix urlPrefix) } return new IPEndPoint(ip, urlPrefix.PortValue); +} + +static void LogOpenSSLVersion() +{ + using var process = new Process() + { + StartInfo = + { + FileName = "/usr/bin/env", + Arguments = "openssl version", + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + CreateNoWindow = true + }, + }; + + process.Start(); + process.WaitForExit(); + var output = process.StandardOutput.ReadToEnd(); + Console.WriteLine("In app openssl version: " + output); } \ No newline at end of file From 6480bd12f83ab09f20cc5c4ba6d5a8fe552f0b56 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 18:11:59 +0100 Subject: [PATCH 40/43] dont use before script --- scenarios/tls.benchmarks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 68c46f8de..c854096ba 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -44,7 +44,6 @@ jobs: dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel port: 8080 readyStateText: Application started. - beforeScript: "openssl version" environmentVariables: urls: "https://*:8080" # any ip, port 8080 mTLS: false From 6a9e0213e985dddd026be1de294226d41c30aec7 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 18:28:03 +0100 Subject: [PATCH 41/43] build fix --- src/BenchmarksApps/TLS/Kestrel/Program.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/BenchmarksApps/TLS/Kestrel/Program.cs b/src/BenchmarksApps/TLS/Kestrel/Program.cs index fd7248225..3e8d50e01 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Program.cs +++ b/src/BenchmarksApps/TLS/Kestrel/Program.cs @@ -224,7 +224,6 @@ static IPEndPoint CreateIPEndPoint(UrlPrefix urlPrefix) return protocols; } -} static void LogOpenSSLVersion() { From d54b043068907b32c819d875bf1eaf0f7af281d4 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Thu, 23 Jan 2025 18:30:00 +0100 Subject: [PATCH 42/43] prettify + no links to custom repo --- scenarios/tls.benchmarks.yml | 4 ++-- src/BenchmarksApps/TLS/Kestrel/Program.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scenarios/tls.benchmarks.yml b/scenarios/tls.benchmarks.yml index 8c4fd3626..2d8bd9ac1 100644 --- a/scenarios/tls.benchmarks.yml +++ b/scenarios/tls.benchmarks.yml @@ -44,8 +44,8 @@ jobs: dockerLinuxKestrelServer: sources: dockerKestrel: - repository: https://github.com/deaglegross/benchmarks.git - branchOrCommit: dmkorolev/idna/openssl-versioning + repository: https://github.com/aspnet/benchmarks.git + branchOrCommit: main dockerFile: dockerKestrel/src/BenchmarksApps/TLS/Kestrel/Dockerfile dockerImageName: dockerKestrel dockerContextDirectory: dockerKestrel/src/BenchmarksApps/TLS/Kestrel diff --git a/src/BenchmarksApps/TLS/Kestrel/Program.cs b/src/BenchmarksApps/TLS/Kestrel/Program.cs index 3e8d50e01..76f78a072 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Program.cs +++ b/src/BenchmarksApps/TLS/Kestrel/Program.cs @@ -243,5 +243,5 @@ static void LogOpenSSLVersion() process.Start(); process.WaitForExit(); var output = process.StandardOutput.ReadToEnd(); - Console.WriteLine("In app openssl version: " + output); + Console.WriteLine(output); } \ No newline at end of file From 5987d3b478e09a450f5e9242596355bea5e6bdf2 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Wed, 29 Jan 2025 23:56:24 +0100 Subject: [PATCH 43/43] validate we are on linux or macos --- src/BenchmarksApps/TLS/Kestrel/Program.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/BenchmarksApps/TLS/Kestrel/Program.cs b/src/BenchmarksApps/TLS/Kestrel/Program.cs index 76f78a072..d4ad8ef25 100644 --- a/src/BenchmarksApps/TLS/Kestrel/Program.cs +++ b/src/BenchmarksApps/TLS/Kestrel/Program.cs @@ -1,6 +1,7 @@ using System.Diagnostics; using System.Net; using System.Net.Security; +using System.Runtime.InteropServices; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using Microsoft.AspNetCore.Authentication.Certificate; @@ -227,6 +228,11 @@ static IPEndPoint CreateIPEndPoint(UrlPrefix urlPrefix) static void LogOpenSSLVersion() { + if (!(OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())) + { + return; + } + using var process = new Process() { StartInfo =