Benchmarks
Benchmarks copied to clipboard
Techempower Results for My workload
I am trying to determine the best results for running in Kubernetes and maximum throughput for my usecase. I am attempting to target at least 3000 requests per second. Right now, 30 pods with 1000m of cpu and 1000Mi of memory, Handles up until about 2000 req/s until it collapses and the response times go up exponentially. It's basically 2000 req/s at 100ms response time, and then shoots up to 1 + seconds response time by 2500 req/s
I know I would need to do a bit of profiling to determine the cause. But I was wondering what are the recommended settings in a Linux environment with either an alpine or debian image with 1000m cpu and 1000Mi of memory.
For example here is my csproj.
<PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel> <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> </PropertyGroup>
command ran to publish
dotnet publish -o ../output -c Release -r alpine-x64
dockerfile.
FROM mcr.microsoft.com/dotnet/core/runtime:3.1.2-alpine
ENV ASPNETCORE_URLS http://*:8080
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 8080
COPY /output ./run
WORKDIR /run
ENTRYPOINT ["dotnet", "app.dll"]
I am also looking at the Benchmarks/Program.cs for Kestrel.
var hostBuilder = new WebHostBuilder()
.UseBenchmarksConfiguration(config)
.UseKestrel((context, options) =>
{
var endPoint = context.Configuration.CreateIPEndPoint();
options.Listen(endPoint, builder =>
{
builder.UseHttpApplication<BenchmarkApplication>();
});
})
.UseStartup<Startup>();
#if NET5_0 || NET6_0
hostBuilder.UseSockets(options =>
{
options.WaitForDataBeforeAllocatingBuffer = false;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
options.UnsafePreferInlineScheduling = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_NET_SOCKETS_INLINE_COMPLETIONS") == "1";
}
});
#endif
var host = hostBuilder.Build();
return host;
What are some of these settings doing? Should I implement them as well?
I know I would need to do a bit of profiling to determine the cause. But I was wondering what are the recommended settings in a Linux environment with either an alpine or debian image with 1000m cpu and 1000Mi of memory.
What is your application doing?
What are some of these settings doing? Should I implement them as well?
No you shouldn't unless you understand the implications.