From 3998d400cd70d384c3dab49c6189101f78592383 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Mon, 3 Feb 2025 13:44:26 +0100 Subject: [PATCH 1/6] add rejection scenarios --- scenarios/rejection.benchmarks.yml | 72 ++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 scenarios/rejection.benchmarks.yml diff --git a/scenarios/rejection.benchmarks.yml b/scenarios/rejection.benchmarks.yml new file mode 100644 index 000000000..53985cb8b --- /dev/null +++ b/scenarios/rejection.benchmarks.yml @@ -0,0 +1,72 @@ +imports: + - 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 + +variables: + serverPort: 5000 + +jobs: + httpSysServer: + source: + repository: https://github.com/aspnet/benchmarks.git + branchOrCommit: main + project: src/BenchmarksApps/TLS/HttpSys/HttpSys.csproj + readyStateText: Application started. + variables: + # behavioral settings + mTLS: false # enables settings on http.sys to negotiate client cert on connections + tlsRenegotiation: false # enables client cert validation + # debug settings + certValidationConsoleEnabled: false + httpSysLogs: false + statsEnabled: false + logRequestDetails: false + arguments: "--urls https://{{serverAddress}}:{{serverPort}} --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}} --httpSysLogs {{httpSysLogs}} --logRequestDetails {{logRequestDetails}}" + + kestrelServer: + source: + repository: https://github.com/aspnet/benchmarks.git + branchOrCommit: main + project: src/BenchmarksApps/TLS/Kestrel/Kestrel.csproj + readyStateText: Application started. + variables: + # behavioral settings + mTLS: false + tlsRenegotiation: false + tlsProtocols: "tls12,tls13" + # debug settings + certValidationConsoleEnabled: false + statsEnabled: false + logRequestDetails: false + arguments: "--urls https://{{serverAddress}}:{{serverPort}} --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --tlsProtocols {{tlsProtocols}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}} --logRequestDetails {{logRequestDetails}}" + +scenarios: + +# HTTP.SYS + + httpsys-encoded-url: + application: + job: httpSysServer + load: + job: httpclient + variables: + path: /hello-world/%09 + presetHeaders: connectionclose + connections: 32 + serverScheme: https + sslProtocol: tls12 + +# Kestrel + + kestrel-encoded-url: + application: + job: kestrelServer + load: + job: httpclient + variables: + path: /hello-world/%09 + presetHeaders: connectionclose + connections: 32 + serverScheme: https + sslProtocol: tls12 \ No newline at end of file From 34af8f40f94e7f15cc9a46e0f92eaf9359ea3497 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Mon, 3 Feb 2025 13:44:26 +0100 Subject: [PATCH 2/6] try? --- scenarios/rejection.benchmarks.yml | 87 ++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 scenarios/rejection.benchmarks.yml diff --git a/scenarios/rejection.benchmarks.yml b/scenarios/rejection.benchmarks.yml new file mode 100644 index 000000000..892ecfa9f --- /dev/null +++ b/scenarios/rejection.benchmarks.yml @@ -0,0 +1,87 @@ +imports: + - 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 + +variables: + serverPort: 5000 + +jobs: + httpSysServer: + source: + repository: https://github.com/aspnet/benchmarks.git + branchOrCommit: main + project: src/BenchmarksApps/TLS/HttpSys/HttpSys.csproj + readyStateText: Application started. + variables: + # behavioral settings + mTLS: false # enables settings on http.sys to negotiate client cert on connections + tlsRenegotiation: false # enables client cert validation + # debug settings + certValidationConsoleEnabled: false + httpSysLogs: false + statsEnabled: false + logRequestDetails: false + arguments: "--urls https://{{serverAddress}}:{{serverPort}} --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}} --httpSysLogs {{httpSysLogs}} --logRequestDetails {{logRequestDetails}}" + + kestrelServer: + source: + repository: https://github.com/aspnet/benchmarks.git + branchOrCommit: main + project: src/BenchmarksApps/TLS/Kestrel/Kestrel.csproj + readyStateText: Application started. + variables: + # behavioral settings + mTLS: false + tlsRenegotiation: false + tlsProtocols: "tls12,tls13" + # debug settings + certValidationConsoleEnabled: false + statsEnabled: false + logRequestDetails: false + arguments: "--urls https://{{serverAddress}}:{{serverPort}} --mTLS {{mTLS}} --certValidationConsoleEnabled {{certValidationConsoleEnabled}} --tlsProtocols {{tlsProtocols}} --statsEnabled {{statsEnabled}} --tlsRenegotiation {{tlsRenegotiation}} --logRequestDetails {{logRequestDetails}}" + +scenarios: + +# HTTP.SYS + + httpsys-encoded-url: + application: + job: httpSysServer + load: + job: httpclient + variables: + path: /hello-world/%09 + presetHeaders: connectionclose + connections: 32 + serverScheme: https + sslProtocol: tls12 + + + +# Kestrel + + kestrel-encoded-url: + application: + job: kestrelServer + load: + job: httpclient + variables: + path: /hello-world/%09 + presetHeaders: connectionclose + connections: 32 + serverScheme: https + sslProtocol: tls12 + + kestrel-header-symbols: + application: + job: kestrelServer + load: + job: httpclient + variables: + path: /hello-world/%09 + presetHeaders: connectionclose + connections: 32 + serverScheme: https + sslProtocol: tls12 + header: "User-Agent: Québec" \ No newline at end of file From 8dda5680abbaa78b6fb34b13b6660485bafbc5a1 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Mon, 3 Feb 2025 13:54:54 +0100 Subject: [PATCH 3/6] try try --- scenarios/rejection.benchmarks.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scenarios/rejection.benchmarks.yml b/scenarios/rejection.benchmarks.yml index e32bc079e..1dea0b949 100644 --- a/scenarios/rejection.benchmarks.yml +++ b/scenarios/rejection.benchmarks.yml @@ -57,8 +57,6 @@ scenarios: serverScheme: https sslProtocol: tls12 - - # Kestrel kestrel-encoded-url: @@ -77,11 +75,10 @@ scenarios: application: job: kestrelServer load: - job: httpclient + job: bombardier variables: - path: /hello-world/%09 - presetHeaders: connectionclose + path: /hello-world connections: 32 serverScheme: https - sslProtocol: tls12 - header: "User-Agent: Québec" + customHeaders: + - X-Custom: "Québec" \ No newline at end of file From d1beca699cd8bbcd76fb34bebb83dca6169b8a47 Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Mon, 3 Feb 2025 14:14:01 +0100 Subject: [PATCH 4/6] add mismatch header --- scenarios/rejection.benchmarks.yml | 45 ++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/scenarios/rejection.benchmarks.yml b/scenarios/rejection.benchmarks.yml index 1dea0b949..e06d15ae5 100644 --- a/scenarios/rejection.benchmarks.yml +++ b/scenarios/rejection.benchmarks.yml @@ -1,6 +1,5 @@ imports: - 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 variables: @@ -49,13 +48,36 @@ scenarios: application: job: httpSysServer load: - job: httpclient + job: bombardier variables: path: /hello-world/%09 presetHeaders: connectionclose connections: 32 serverScheme: https - sslProtocol: tls12 + + httpsys-header-symbols: + application: + job: httpSysServer + load: + job: bombardier + variables: + path: /hello-world + connections: 32 + serverScheme: https + customHeaders: + - X-Custom: "Québec" + + httpsys-hostheader-mismatch: + application: + job: httpSysServer + load: + job: bombardier + variables: + path: /hello-world + connections: 32 + serverScheme: https + customHeaders: + - Host: "google.com" # Kestrel @@ -63,13 +85,12 @@ scenarios: application: job: kestrelServer load: - job: httpclient + job: bombardier variables: path: /hello-world/%09 presetHeaders: connectionclose connections: 32 serverScheme: https - sslProtocol: tls12 kestrel-header-symbols: application: @@ -81,4 +102,16 @@ scenarios: connections: 32 serverScheme: https customHeaders: - - X-Custom: "Québec" \ No newline at end of file + - X-Custom: "Québec" + + kestrel-hostheader-mismatch: + application: + job: kestrelServer + load: + job: bombardier + variables: + path: /hello-world + connections: 32 + serverScheme: https + customHeaders: + - Host: "google.com" From 6bff4a14b67ed380327b8f82a9c06543844067cd Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Mon, 3 Feb 2025 14:30:43 +0100 Subject: [PATCH 5/6] change to 400 route --- scenarios/rejection.benchmarks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scenarios/rejection.benchmarks.yml b/scenarios/rejection.benchmarks.yml index e06d15ae5..fc554262c 100644 --- a/scenarios/rejection.benchmarks.yml +++ b/scenarios/rejection.benchmarks.yml @@ -50,7 +50,7 @@ scenarios: load: job: bombardier variables: - path: /hello-world/%09 + path: /unknown/%09 presetHeaders: connectionclose connections: 32 serverScheme: https @@ -87,7 +87,7 @@ scenarios: load: job: bombardier variables: - path: /hello-world/%09 + path: /unknown/%09 presetHeaders: connectionclose connections: 32 serverScheme: https From 357a26436c5dccb44a89c9f802c38bbc97eeadcf Mon Sep 17 00:00:00 2001 From: Dmitrii Korolev Date: Mon, 3 Feb 2025 14:39:39 +0100 Subject: [PATCH 6/6] add descr --- scenarios/rejection.benchmarks.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scenarios/rejection.benchmarks.yml b/scenarios/rejection.benchmarks.yml index fc554262c..8a2b1bf9d 100644 --- a/scenarios/rejection.benchmarks.yml +++ b/scenarios/rejection.benchmarks.yml @@ -1,3 +1,7 @@ +# Contains test to compare HTTP.SYS and Kestrel performance on some specific scenarios, +# where servers (probably) should reject the request early (i.e. mismatching `Host` header) +# to make request processing as performant as possible + imports: - https://raw.githubusercontent.com/dotnet/crank/main/src/Microsoft.Crank.Jobs.Bombardier/bombardier.yml - https://github.com/aspnet/Benchmarks/blob/main/scenarios/aspnet.profiles.yml?raw=true