Avatar of Easwaran Paramasivam
Easwaran Paramasivam
Flag for India asked on

Identify CPU Utilization and restart the service if the CPU utilization is more

Dear Experts,
 
  I've a windows service. If the service consumes more CPU utilization (say for instance 85% - which I could configure in config file and read in application) then I would like to restart the service. Could you please let me know how to achieve this?


Thanks.
C#.NET Programming

Avatar of undefined
Last Comment
Easwaran Paramasivam

8/22/2022 - Mon
it_saige

You could throw an event that would tell the service to restart itself.  But then the question becomes, why is it consuming so much processor utilization?  Do you have an idea as to why your service does this?

-saige-
Easwaran Paramasivam

ASKER
Thanks. Some threads  are running for 2 days continuously. They are unmanaged threads. Hence could not identify the root cause of the issue. Please explain your solution how to achieve in code. Thanks.
it_saige

Sure thing.  Let me throw a project together for illustrative purposes.

-saige-
Your help has saved me hundreds of hours of internet surfing.
fblack61
Easwaran Paramasivam

ASKER
@it_saige: Waiting for your response. Thanks.
Easwaran Paramasivam

ASKER
@it_saige: Could you please share the project?
Easwaran Paramasivam

ASKER
@it_saige: Awaiting your reply. Kindly assist.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
it_saige

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Easwaran Paramasivam

ASKER
Thanks a lot.