Closed livarcocc closed 6 years ago
@sebastienros - can you take a look at this?
1- Do you have Console logging enabled? If so please try without it.
2- How are you creating the concurrent load? I can see the serial one only, using curl
commands.
1- Disabling Console logging changed nothing. 2- By attaching '&' at the end of the curl command, it runs in the background. I tested sequential request without '&', concurrent request with '&' and there's really big performance gap between the results of two.
Changing SetMinThreads to (1024, 1024) which was 100, 100 before gave me some improvements. Now handling time of slow requests ranges 100 ~ 1500ms
Sorry I missed to tell you that aboves ran in Debug mode with Jetbrains Rider debugger attached. without debugger, 50 concurrent request also runs super fast. But I'm still curious what makes concurrent request slower than sequential request.
We do a lot of perf testing on aspnet, the results are available here: https://aka.ms/aspnet/benchmarks, so I am quite confident there is a flaw in your testing. Can we agree on the methodology and try again your app?
dotnet publish -c Release -o c:\temp\myapp
dotnet c:\temp\myapp\myapp.dll
In parallel I will try to reproduce your numbers locally to understand what is happening. Could you share the exact application somewhere (on github for instance) to be sure we are testing the same thing?
Debugger seems to be a bottleneck. without debugger, it runs with no problem. It seems inadequate to measure performance with debugger attached, so it was my fault after all.
repro github For reproduction, you can test it with jetbrain rider 2017.3.1 debugger attached.
Yes, the debugger can add an enormous amount of overhead to the system. Some parts of the system change their behavior when they detect an attached debugger to offer additional diagnostic information, which slows things down.
Given that this was running with the debugger, I'm closing this issue. Thanks!
As a note, your debug performance issue will likely be fixed by https://github.com/dotnet/coreclr/issues/18705 (coming in 2.2)
From @rkdrnfds on March 29, 2018 6:43
Request handling extremely slows down on concurrent requests
Against above controller, I tested concurrent request using shell script below
For sequential request, there's almost no delay for processing requests. consuming about 1~5ms per request. but For concurrent request, handling time varies from 100ms ~ 2000ms
There's light middleware attached for logging execution time.
Below are collected logs for slow request. (one of 50 requests. others also have similar logs)
I tried manipulating
ThreadPool.SetMinThreads
andKestrelServerOptions.Limits.MaxConcurrentConnection
but nothing had any effect.Environment data
Copied from original issue: dotnet/cli#8930