0

I am working on a project where I need to find a way to decrease CPU usage for all running programs on a Windows system. I understand that controlling the resource usage of other programs directly is not feasible, but I would like to explore any possible approaches or suggestions to achieve this goal.

I have already considered setting process priorities and affinities to lower values, but it seems to only affect the priority of my own application and not other running programs.

I would like to know if there are any alternative methods or techniques that can be employed from within a C# application to reduce the overall CPU usage on the system. My intention is not to interfere with system processes or critical tasks but rather to create a background service that can help optimize CPU usage for user applications, especially in scenarios where the system is under heavy load.

Any insights, suggestions, or code examples would be greatly appreciated. Thank you!

Frost Dream
  • 1
  • 2
  • 13
  • 3
    You want to make a Windows service that achieves more effective CPU utilization by doing better job at scheduling threads than the Windows thread scheduler? Or you want to slow down all programs equally so that the task manager shows that a significant portion of the CPU resources [are free](https://devblogs.microsoft.com/oldnewthing/20101203-00/?p=12123)? – GSerg Jun 13 '23 at 18:37
  • Hyper-V can limit CPU for a whole VM. https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/manage/manage-hyper-v-cpugroups#setting-cpu-caps-on-individual-vms – David Browne - Microsoft Jun 13 '23 at 18:37
  • 1
    CPU usage is typically expressed as a percentage. The easiest way to reduce it is to increase the denominator, i.e. increase CPU capacity. Should I assume this is not an option? – John Wu Jun 13 '23 at 18:58
  • Also, see [Can you limit the CPU usage on a .NET Process Object?](https://stackoverflow.com/a/9793403/2791540) – John Wu Jun 13 '23 at 19:00
  • Decreasing the priority of all other processes is like increasing yours only. Do that. Ignore the other processes. – Enigmativity Jun 15 '23 at 12:27
  • I want to cold my pc. – Frost Dream Jun 15 '23 at 17:19
  • to "cold" your PC, limit CPU frequency. there are system settings for that. or install a better heat sink. – Christoph Rackwitz Jun 25 '23 at 13:57

0 Answers0