-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPU usage increases after upgrading to .NET 6 #83505
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @mangod9 Issue DetailsDescriptionOur ASP.NET Core service's CPU usage increases a lot after upgrading from .NET Core 3.1 to .NET 6.0.14, we collected a trace using dotnet-trace and found that our problem is pretty similar with #62967. We tried to disable the usage of portable thread pool with setting I compared the trace under ".NET 6" with ".NET Core 3.1" and found the increased CPU usage might be caused by Could anyone suggest what steps I need to take to resolve this? I could not share the netrace file here as it contains production data but I could share it to MS internal members, feel free to drop me a message if a netrace file could help. Configuration
Regression?That looks like a regression, I did not observe similar CPU usage in .NET Core 3.1 DataCPU usage increased after we rollout new version which upgrade to .NET 6. Analysisakkadotnet/akka.net#5385 (comment) mentioned that similar CPU regression could be fixed by upgrading the runtime version to 6.0.6, however our runtime version is 6.0.14 already. For
|
One more question: have you observed other metrics change? Like RPS for example or reduced latency? Maybe something else? |
Chatted offline, the times shown in the first two stacks are likely mostly blocked time and not CPU time, suggested using perfcollect instead. |
That is related to #84760, close it. |
Description
Our ASP.NET Core service's CPU usage increases a lot after upgrading from .NET Core 3.1 to .NET 6.0.14, we collected a trace using dotnet-trace and found that our problem is pretty similar with #62967. We tried to disable the usage of portable thread pool with setting
COMPlus_ThreadPool_UsePortableThreadPool=0
, the trick works in our test environment, we observed CPU usage decreased as expected under stressing test, however in production, we noticed that the problem persisted.I compared the trace under ".NET 6" with ".NET Core 3.1" and found the increased CPU usage might be caused by
Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.Heartbeat.TimerLoop()
andSystem.Diagnostics.Tracing.CounterGroup.PollForValues()
Could anyone suggest what steps I need to take to resolve this?
I could not share the netrace file here as it contains production data but I could share it to MS internal members, feel free to drop me a message if a netrace file could help.
Configuration
Regression?
That looks like a regression, I did not observe similar CPU usage in .NET Core 3.1
Data
CPU usage increased after we rollout new version which upgrade to .NET 6.
Analysis
akkadotnet/akka.net#5385 (comment) mentioned that similar CPU regression could be fixed by upgrading the runtime version to 6.0.6, however our runtime version is 6.0.14 already.
For
Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.Heartbeat.TimerLoop()
's CPU usage dotnet/aspnetcore#47014 explained that the data is actually somewhat misleading, since it includes time that the thread was waiting as well.The text was updated successfully, but these errors were encountered: