Skip to content

Commit

Permalink
[HTTP/SSL] Fix stress (#93135)
Browse files Browse the repository at this point in the history
* Fix stress docker images and ignore file

* Fix msquic build to use openssl3

* Fix SSL stress version

* SSL stress fixes
  • Loading branch information
ManickaP authored Oct 9, 2023
1 parent 4001e07 commit 903321a
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 23 deletions.
3 changes: 0 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,3 @@

# performance testing sandbox
**/sandbox

#IL linker for testing
**/linker
4 changes: 2 additions & 2 deletions eng/docker/libraries-sdk.linux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Builds and copies library artifacts into target dotnet sdk image
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:7.0-bullseye-slim
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:8.0

FROM $BUILD_BASE_IMAGE as corefxbuild

Expand All @@ -12,7 +12,7 @@ RUN ./build.sh clr+libs -runtimeconfiguration Release -configuration $CONFIGURAT

FROM $SDK_BASE_IMAGE as target

ARG VERSION=8.0
ARG VERSION=9.0
ARG CONFIGURATION=Release
ENV _DOTNET_INSTALL_CHANNEL="$VERSION.1xx"

Expand Down
4 changes: 2 additions & 2 deletions eng/docker/libraries-sdk.windows.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# escape=`
# Simple Dockerfile which copies clr and library build artifacts into target dotnet sdk image
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:7.0-nanoserver-ltsc2022
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:8.0-nanoserver-ltsc2022
FROM $SDK_BASE_IMAGE as target

SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ARG VERSION=8.0
ARG VERSION=9.0
ENV _DOTNET_INSTALL_CHANNEL="$VERSION.1xx"
ARG CONFIGURATION=Release

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:7.0-bullseye-slim
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:8.0
FROM $SDK_BASE_IMAGE

# Build latest msquic locally
Expand All @@ -10,7 +10,7 @@ RUN apt-get update -y && \
RUN git clone --recursive https://github.com/dotnet/msquic
RUN cd msquic/src/msquic && \
mkdir build && \
cmake -B build -DCMAKE_BUILD_TYPE=Release -DQUIC_ENABLE_LOGGING=false -DQUIC_USE_SYSTEM_LIBCRYPTO=true -DQUIC_BUILD_TOOLS=off -DQUIC_BUILD_TEST=off -DQUIC_BUILD_PERF=off && \
cmake -B build -DCMAKE_BUILD_TYPE=Release -DQUIC_ENABLE_LOGGING=false -DQUIC_USE_SYSTEM_LIBCRYPTO=true -DQUIC_BUILD_TOOLS=off -DQUIC_BUILD_TEST=off -DQUIC_BUILD_PERF=off -DQUIC_TLS=openssl3 && \
cd build && \
cmake --build . --config Release
RUN cd msquic/src/msquic/build/bin/Release && \
Expand All @@ -20,7 +20,7 @@ RUN cd msquic/src/msquic/build/bin/Release && \
$( ls ./* | cut -d "/" -f 2 | sed -r "s/(.*)/\1=\/usr\/lib\/\1/g" ) && \
dpkg -i libmsquic_*.deb

ARG VERSION=8.0
ARG VERSION=9.0
ARG CONFIGURATION=Release

# Build the stress server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ private static async Task<ExitCode> Run(Configuration config)

string GetAssemblyInfo(Assembly assembly) => $"{assembly.Location}, modified {new FileInfo(assembly.Location).LastWriteTime}";

Type msQuicApiType = Type.GetType("System.Net.Quic.MsQuicApi, System.Net.Quic");
string msQuicLibraryVersion = (string)msQuicApiType.GetProperty("MsQuicLibraryVersion", BindingFlags.NonPublic | BindingFlags.Static).GetGetMethod(true).Invoke(null, Array.Empty<object?>());
Type msQuicApiType = Type.GetType("System.Net.Quic.MsQuicApi, System.Net.Quic")!;
string msQuicLibraryVersion = (string)msQuicApiType.GetProperty("MsQuicLibraryVersion", BindingFlags.NonPublic | BindingFlags.Static)!.GetGetMethod(true)!.Invoke(null, Array.Empty<object?>())!;

Console.WriteLine(" .NET Core: " + GetAssemblyInfo(typeof(object).Assembly));
Console.WriteLine(" ASP.NET Core: " + GetAssemblyInfo(typeof(WebHost).Assembly));
Expand Down Expand Up @@ -192,8 +192,8 @@ private static async Task<ExitCode> Run(Configuration config)
{
// If the system gets overloaded, MsQuic has a tendency to drop incoming connections, see https://github.com/dotnet/runtime/issues/55979.
// So in case we're running H/3 stress test, we're using the same hack as for System.Net.Quic tests, which increases the time limit for pending operations in MsQuic thread pool.
object msQuicApiInstance = msQuicApiType.GetProperty("Api", BindingFlags.NonPublic | BindingFlags.Static).GetGetMethod(true).Invoke(null, Array.Empty<object?>());
QUIC_API_TABLE* apiTable = (QUIC_API_TABLE*)(Pointer.Unbox(msQuicApiType.GetProperty("ApiTable").GetGetMethod().Invoke(msQuicApiInstance, Array.Empty<object?>())));
object msQuicApiInstance = msQuicApiType.GetProperty("Api", BindingFlags.NonPublic | BindingFlags.Static)!.GetGetMethod(true)!.Invoke(null, Array.Empty<object?>())!;
QUIC_API_TABLE* apiTable = (QUIC_API_TABLE*)(Pointer.Unbox(msQuicApiType.GetProperty("ApiTable")!.GetGetMethod()!.Invoke(msQuicApiInstance, Array.Empty<object?>())!));
QUIC_SETTINGS settings = default(QUIC_SETTINGS);
settings.IsSet.MaxWorkerQueueDelayUs = 1;
settings.MaxWorkerQueueDelayUs = 2_500_000u; // 2.5s, 10x the default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# escape=`
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:7.0-nanoserver-ltsc2022
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:8.0-nanoserver-ltsc2022
FROM $SDK_BASE_IMAGE

# Use powershell as the default shell
Expand All @@ -8,7 +8,7 @@ SHELL ["pwsh", "-Command"]
WORKDIR /app
COPY . .

ARG VERSION=8.0
ARG VERSION=9.0
ARG CONFIGURATION=Release

RUN dotnet build -c $env:CONFIGURATION `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# In SslStress it's a thin utility to generate a runscript for running the app with the live-built testhost.
# The main reason to use an equivalent solution in SslStress is consistency with HttpStress.

$Version="8.0"
$Version="9.0"
$RepoRoot="$(git rev-parse --show-toplevel)"
$DailyDotnetRoot= "./.dotnet-daily"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
Define this here because the SDK resets it
unconditionally in Microsoft.NETCoreSdk.BundledVersions.props.
-->
<NETCoreAppMaximumVersion>8.0</NETCoreAppMaximumVersion>
<NETCoreAppMaximumVersion>9.0</NETCoreAppMaximumVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-bullseye-slim
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:8.0
FROM $SDK_BASE_IMAGE

WORKDIR /app
COPY . .
WORKDIR /app/System.Net.Security/tests/StressTests/SslStress

ARG VERSION=8.0
ARG VERSION=9.0
ARG CONFIGURATION=Release

RUN dotnet build -c $CONFIGURATION \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
# In SslStress it's a thin utility to generate a runscript for running the app with the live-built testhost.
# The main reason to use an equivalent solution in SslStress is consistency with HttpStress.

version=8.0
version=9.0
repo_root=$(git rev-parse --show-toplevel)
daily_dotnet_root=./.dotnet-daily

stress_configuration="Release"
if [ "$1" != "" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# escape=`
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-nanoserver-1809
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:8.0-nanoserver-ltsc2022
FROM $SDK_BASE_IMAGE

# Use powershell as the default shell
Expand All @@ -9,7 +9,7 @@ WORKDIR /app
COPY . .
WORKDIR /app/System.Net.Security/tests/StressTests/SslStress

ARG VERSION=8.0
ARG VERSION=9.0
ARG CONFIGURATION=Release

RUN dotnet build -c $env:CONFIGURATION `
Expand Down

0 comments on commit 903321a

Please sign in to comment.