You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The aspnet core version was pinned for both runs showing that the reason seems to be a runtime change. Unfortunately there was no successful runtime build+publication during this window so I can't get more precise that this.
At that point I suggest that someone tries to identify which commits might be related, and try to rebuild the impacted assets of these commits, so we can test them on the benchmark to identity the root cause.
Why I thought it might need the AMD fix #31904 is recently Kestrel changed from using its own ASCII encoding to use Encoding.ASCII.GetBytesdotnet/aspnetcore#18404 so would be dependent on and effected by any runtime regressions. However that was merged on 11 Feb so should be in the before and not the after.
It's interesting that the CPU consumption was never 100% and the RPS for this 48 core machine is smaller compared to the machine which has only 12 cores.
I suspect that there is some underlying scalability issue and my change in #2346 has for some reason made it even worse.
As soon as we get PerfCollect to work on this machine I would be more than happy to analyze the trace files and identify the problem.
The AMD machine has been available for a week only, and is on Linux.
I have seen other unusual behaviors on this machine that I need to investigate, related to the number of cores, so this might be related to Adam's suspicion. I will gather some data.
While I was working on the TechEmpower recently, I found out that the max number of IO Threads is 16 (for some reason, imho it should be Math.Max(Environment.ProcessorCount / 2, 1)).
Could you try to run some benchmarks on this machine with a bigger number? If I remember correctly, it's configurable via --kestrelthreadcount argument
even by varying the threads count, the results are still bad after the regression
taking the runtime before the change, we can get better results with a different thread count than the default
the performance is not a function of the number of cpus (we would hope for linear)
Right now I am running another script that is varying the available cpus from 1..48, and also the numbers of threads for each number of cpus. That should let us find what default value is best based on the number of cpus. This should also be done on an Intel, citrine having 24 cores.
Triage: This may be related to some SIMD code not being that efficient on AMD (@GrabYourPitchforks@tannergooding).
We should re-benchmark - @adamsitnik do you have latest info?
cc @alnikola can you check if it still shows up in latest results when you get a chance?
I am almost sure it's more related to thread scheduling than instructions. If you check the link you will see that we can get 712K RPS at 20 cores, but it goes down to 187K RPS when using the full 48 cores. This machine being an AMD might not be the cause, but the fact that is has more cores than the other machines we usually test on is adding some new information.
Do we know if it also reproduces on Windows (I can also test in Ubuntu 18.04)? Could someone list where to get the benchmark from and what command line to test with (I didn't see it in dotnet/performance)?
Activity
benaadams commentedon Feb 28, 2020
Running runtime with the AMD fix? #31904
gfoidl commentedon Feb 28, 2020
Do these benchmarks hit dotnet/aspnetcore#19009?
The two PRs should mitigate the regression on AMD.
sebastienros commentedon Feb 28, 2020
This is using the latest builds, so not older than a day. You can see the exact versions that contain the day of the month in it.
We can get the whole published folder, and also traces if needed.
sebastienros commentedon Mar 2, 2020
I have isolated the regression between:
By running the Plaintext NonPipelined scenario (60% regression) like so:
The aspnet core version was pinned for both runs showing that the reason seems to be a runtime change. Unfortunately there was no successful runtime build+publication during this window so I can't get more precise that this.
At that point I suggest that someone tries to identify which commits might be related, and try to rebuild the impacted assets of these commits, so we can test them on the benchmark to identity the root cause.
stephentoub commentedon Mar 3, 2020
Does the regression appear only on Linux or also on Windows?
If it weren't for the fact that I know you and @adamsitnik said you did lots of testing on #2346, that would be my first guess.
benaadams commentedon Mar 3, 2020
Why I thought it might need the AMD fix #31904 is recently Kestrel changed from using its own ASCII encoding to use
Encoding.ASCII.GetBytesdotnet/aspnetcore#18404 so would be dependent on and effected by any runtime regressions. However that was merged on 11 Feb so should be in the before and not the after.benaadams commentedon Mar 3, 2020
Is in the commit range
adamsitnik commentedon Mar 3, 2020
It's interesting that the CPU consumption was never 100% and the RPS for this 48 core machine is smaller compared to the machine which has only 12 cores.
I suspect that there is some underlying scalability issue and my change in #2346 has for some reason made it even worse.
As soon as we get PerfCollect to work on this machine I would be more than happy to analyze the trace files and identify the problem.
sebastienros commentedon Mar 3, 2020
The AMD machine has been available for a week only, and is on Linux.
I have seen other unusual behaviors on this machine that I need to investigate, related to the number of cores, so this might be related to Adam's suspicion. I will gather some data.
adamsitnik commentedon Mar 3, 2020
While I was working on the TechEmpower recently, I found out that the max number of IO Threads is 16 (for some reason, imho it should be
Math.Max(Environment.ProcessorCount / 2, 1)).Could you try to run some benchmarks on this machine with a bigger number? If I remember correctly, it's configurable via
--kestrelthreadcountargumenthttps://github.com/dotnet/aspnetcore/blob/34ee3324fb4a8c8de4ebdee6a6c8ecdbe5891236/src/Servers/Kestrel/Transport.Sockets/src/SocketTransportOptions.cs#L17
sebastienros commentedon Mar 4, 2020
I have gathered some data by varying the # of core and IOQueue threads. I'll share the results when I have find some time.
sebastienros commentedon Mar 5, 2020
Here are some intermediate results: https://gist.github.com/sebastienros/ac204507c98bb2f1d2d38f15d444e572
I ran Plaintext Non Pipelined on the AMD machine (Ubuntu 18.03) with the two runtime versions that show the regression. I did so by making from 1 to 48 cores available. Then for each version pinned to 48 cores and varied the IOQueue threads from 1 to 48, instead of its default value of 16 (https://github.com/dotnet/aspnetcore/blob/34ee3324fb4a8c8de4ebdee6a6c8ecdbe5891236/src/Servers/Kestrel/Transport.Sockets/src/SocketTransportOptions.cs#L17)
What it tells us is:
Right now I am running another script that is varying the available cpus from 1..48, and also the numbers of threads for each number of cpus. That should let us find what default value is best based on the number of cpus. This should also be done on an Intel, citrine having 24 cores.
/cc @halter73
karelz commentedon Mar 12, 2020
Triage: This may be related to some SIMD code not being that efficient on AMD (@GrabYourPitchforks @tannergooding).
We should re-benchmark - @adamsitnik do you have latest info?
cc @alnikola can you check if it still shows up in latest results when you get a chance?
sebastienros commentedon Mar 12, 2020
I am almost sure it's more related to thread scheduling than instructions. If you check the link you will see that we can get 712K RPS at 20 cores, but it goes down to 187K RPS when using the full 48 cores. This machine being an AMD might not be the cause, but the fact that is has more cores than the other machines we usually test on is adding some new information.
karelz commentedon Mar 12, 2020
In that case, I wonder if it is even Networking related ... @adamsitnik can you please help shed some light here?
tannergooding commentedon Mar 12, 2020
I have a 12-core/24-thread AMD box I can test on.
Do we know if it also reproduces on Windows (I can also test in Ubuntu 18.04)? Could someone list where to get the benchmark from and what command line to test with (I didn't see it in dotnet/performance)?
tannergooding commentedon Mar 12, 2020
You might also have some luck trying to collect a profile using https://developer.amd.com/amd-uprof/ to see what the hotspot differences are.
adamsitnik commentedon Mar 12, 2020
@sebastienros I am getting a new error when downloading the trace file.
dotnet run --- --jobs ..\BenchmarksApps\Kestrel\PlatformBenchmarks\benchmarks.plaintext.json --scenario "PlaintextPlatform" --collect-traceadamsitnik commentedon Mar 12, 2020
It's one of the ASP.NET TechEmpower benchmarks. As soon as I get the trace I am going to share it with you
sebastienros commentedon Mar 23, 2020
Closing this as it was fixed with Adam reverting the epoll change.