1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-08 03:27:04 +09:00

[HTTP/SSL] Fix stress (#93135)

* Fix stress docker images and ignore file

* Fix msquic build to use openssl3

* Fix SSL stress version

* SSL stress fixes
This commit is contained in:
Marie Píchová 2023-10-09 11:54:41 +02:00 committed by GitHub
parent 4001e074ee
commit 903321a30f
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 21 additions and 23 deletions

View file

@ -332,6 +332,3 @@
# performance testing sandbox # performance testing sandbox
**/sandbox **/sandbox
#IL linker for testing
**/linker

View file

@ -1,6 +1,6 @@
# Builds and copies library artifacts into target dotnet sdk image # Builds and copies library artifacts into target dotnet sdk image
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8 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 FROM $BUILD_BASE_IMAGE as corefxbuild
@ -12,7 +12,7 @@ RUN ./build.sh clr+libs -runtimeconfiguration Release -configuration $CONFIGURAT
FROM $SDK_BASE_IMAGE as target FROM $SDK_BASE_IMAGE as target
ARG VERSION=8.0 ARG VERSION=9.0
ARG CONFIGURATION=Release ARG CONFIGURATION=Release
ENV _DOTNET_INSTALL_CHANNEL="$VERSION.1xx" ENV _DOTNET_INSTALL_CHANNEL="$VERSION.1xx"

View file

@ -1,11 +1,11 @@
# escape=` # escape=`
# Simple Dockerfile which copies clr and library build artifacts into target dotnet sdk image # 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 FROM $SDK_BASE_IMAGE as target
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ARG VERSION=8.0 ARG VERSION=9.0
ENV _DOTNET_INSTALL_CHANNEL="$VERSION.1xx" ENV _DOTNET_INSTALL_CHANNEL="$VERSION.1xx"
ARG CONFIGURATION=Release ARG CONFIGURATION=Release

View file

@ -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 FROM $SDK_BASE_IMAGE
# Build latest msquic locally # Build latest msquic locally
@ -10,7 +10,7 @@ RUN apt-get update -y && \
RUN git clone --recursive https://github.com/dotnet/msquic RUN git clone --recursive https://github.com/dotnet/msquic
RUN cd msquic/src/msquic && \ RUN cd msquic/src/msquic && \
mkdir build && \ 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 && \ cd build && \
cmake --build . --config Release cmake --build . --config Release
RUN cd msquic/src/msquic/build/bin/Release && \ RUN cd msquic/src/msquic/build/bin/Release && \
@ -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" ) && \ $( ls ./* | cut -d "/" -f 2 | sed -r "s/(.*)/\1=\/usr\/lib\/\1/g" ) && \
dpkg -i libmsquic_*.deb dpkg -i libmsquic_*.deb
ARG VERSION=8.0 ARG VERSION=9.0
ARG CONFIGURATION=Release ARG CONFIGURATION=Release
# Build the stress server # Build the stress server

View file

@ -162,8 +162,8 @@ namespace HttpStress
string GetAssemblyInfo(Assembly assembly) => $"{assembly.Location}, modified {new FileInfo(assembly.Location).LastWriteTime}"; string GetAssemblyInfo(Assembly assembly) => $"{assembly.Location}, modified {new FileInfo(assembly.Location).LastWriteTime}";
Type msQuicApiType = Type.GetType("System.Net.Quic.MsQuicApi, System.Net.Quic"); 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?>()); 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(" .NET Core: " + GetAssemblyInfo(typeof(object).Assembly));
Console.WriteLine(" ASP.NET Core: " + GetAssemblyInfo(typeof(WebHost).Assembly)); Console.WriteLine(" ASP.NET Core: " + GetAssemblyInfo(typeof(WebHost).Assembly));
@ -192,8 +192,8 @@ namespace HttpStress
{ {
// If the system gets overloaded, MsQuic has a tendency to drop incoming connections, see https://github.com/dotnet/runtime/issues/55979. // 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. // 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?>()); 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_API_TABLE* apiTable = (QUIC_API_TABLE*)(Pointer.Unbox(msQuicApiType.GetProperty("ApiTable")!.GetGetMethod()!.Invoke(msQuicApiInstance, Array.Empty<object?>())!));
QUIC_SETTINGS settings = default(QUIC_SETTINGS); QUIC_SETTINGS settings = default(QUIC_SETTINGS);
settings.IsSet.MaxWorkerQueueDelayUs = 1; settings.IsSet.MaxWorkerQueueDelayUs = 1;
settings.MaxWorkerQueueDelayUs = 2_500_000u; // 2.5s, 10x the default settings.MaxWorkerQueueDelayUs = 2_500_000u; // 2.5s, 10x the default

View file

@ -1,5 +1,5 @@
# escape=` # 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 FROM $SDK_BASE_IMAGE
# Use powershell as the default shell # Use powershell as the default shell
@ -8,7 +8,7 @@ SHELL ["pwsh", "-Command"]
WORKDIR /app WORKDIR /app
COPY . . COPY . .
ARG VERSION=8.0 ARG VERSION=9.0
ARG CONFIGURATION=Release ARG CONFIGURATION=Release
RUN dotnet build -c $env:CONFIGURATION ` RUN dotnet build -c $env:CONFIGURATION `

View file

@ -7,7 +7,7 @@
# In SslStress it's a thin utility to generate a runscript for running the app with the live-built testhost. # 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. # 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)" $RepoRoot="$(git rev-parse --show-toplevel)"
$DailyDotnetRoot= "./.dotnet-daily" $DailyDotnetRoot= "./.dotnet-daily"

View file

@ -6,6 +6,6 @@
Define this here because the SDK resets it Define this here because the SDK resets it
unconditionally in Microsoft.NETCoreSdk.BundledVersions.props. unconditionally in Microsoft.NETCoreSdk.BundledVersions.props.
--> -->
<NETCoreAppMaximumVersion>8.0</NETCoreAppMaximumVersion> <NETCoreAppMaximumVersion>9.0</NETCoreAppMaximumVersion>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View file

@ -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 FROM $SDK_BASE_IMAGE
WORKDIR /app WORKDIR /app
COPY . . COPY . .
WORKDIR /app/System.Net.Security/tests/StressTests/SslStress WORKDIR /app/System.Net.Security/tests/StressTests/SslStress
ARG VERSION=8.0 ARG VERSION=9.0
ARG CONFIGURATION=Release ARG CONFIGURATION=Release
RUN dotnet build -c $CONFIGURATION \ RUN dotnet build -c $CONFIGURATION \

View file

@ -8,8 +8,9 @@
# In SslStress it's a thin utility to generate a runscript for running the app with the live-built testhost. # 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. # 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) repo_root=$(git rev-parse --show-toplevel)
daily_dotnet_root=./.dotnet-daily
stress_configuration="Release" stress_configuration="Release"
if [ "$1" != "" ]; then if [ "$1" != "" ]; then

View file

@ -1,5 +1,5 @@
# escape=` # 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 FROM $SDK_BASE_IMAGE
# Use powershell as the default shell # Use powershell as the default shell
@ -9,7 +9,7 @@ WORKDIR /app
COPY . . COPY . .
WORKDIR /app/System.Net.Security/tests/StressTests/SslStress WORKDIR /app/System.Net.Security/tests/StressTests/SslStress
ARG VERSION=8.0 ARG VERSION=9.0
ARG CONFIGURATION=Release ARG CONFIGURATION=Release
RUN dotnet build -c $env:CONFIGURATION ` RUN dotnet build -c $env:CONFIGURATION `