8
votes

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.

enter image description here

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.

2
How can we help without knowing anything about your app? Have you tried disabling things in your app until it stops happening?DavidG
It's a generic problem with asp.net core. Anyways what should I do to identify like what's causing 100% CPU usage?Jitendra Pancholi
@DavidG I found github.com/Microsoft/ApplicationInsights-aspnetcore/issues/… while searching on this topic.Jitendra Pancholi

2 Answers

1
votes

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.

0
votes

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'