Application consuming High CPU

Mavliwala, Adnan 1 Reputation point
2021-01-12T10:25:00.277+00:00

Hello,

Our Application is running multiple processes (.exe) and each process utilizing CPU processor is always high while processing which near to 80 to 100% CPU.

  • There is work around to minimize CPU utilization using System.Threading.Thread.Sleep but it is impacting overall processing speed of our business logic.
  • We have tried setting ProcessorAffinity to use 4 core processor but there is no performance improvement.

Please let us know what would be best solution to keep CPU utilization lower than 40 to 50% during processing cycle?

Note: I can't paste code snippet here due to WAF restrictions. please let me know if you need code samples.

Thanks,

Adnan

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,125 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jerry Cai-MSFT 986 Reputation points
    2021-01-13T02:10:22.74+00:00

    Hi,MavliwalaAdnan

    You should check the reason why your CPU is high, and then find specific ways to solve the problem.

    how to debug highcpu

    To lower the high CPU, for example, at the code level, if your code is a big loop, and it is a long-lasting loop, then using multithreading can

    reduce the CPU usage of your program, and to execute two or more lines of code, multithreading and parallel processing programming are your

    good choices.

    Best Regards,
    Jerry Cai


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments