Reputation: 7562
I have developed a website in Asp.Net Core 2.2 and hosted on Azure VM (Windows Server 2016 Data Center) in IIS.
I observed that when I access the website then after few requests, it's CPU usage goes to 100% and website does not respond. When I kill the process (.Net Core Host), then website works fine and then again process consume 100% CPU.
I searched a lot in this and found no solution. Many people are suffering with this and still struggling.
Did anyone encountered this problem and found the solution or any workaround? I am open to upgrade (core 3.0) or downgrade (2.0) for my application if it solves the problem.
Any help would be really appreciated.
Edit: After searching on this, i came to know this https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/690#issuecomment-399046332
That person downgraded the application core v2.1 which solves the high cpu usage problem.
Upvotes: 12
Views: 13751
Reputation: 191
In my case one instance of 'HttpClient' makes CPU usage high, When I changed the code and create new instance for each request CPU usage went down, because of 'HttpClient' disposing problem with more than one instance and a lot of request in my scenario 'HttpClient' was replaced by 'HttpWebRequest'
Upvotes: 1
Reputation: 7562
Finally I fixed the problem by downgraded the framework from asp.net core v2.2 to asp.net core v2.0.0
Upper versions are not stable yet.
Upvotes: 2