Process Hacker Discussion Forum

 
Absol
Member
Posts: 18
Joined: 09 Sep 2013 12:57
OS: Windows 7 32bit

Select max cpu usage for process

05 Mar 2015 11:48

Please add the possibility to select the maximum CPU usage for process.
 
User avatar
dmex
Admin
Posts: 1695
Joined: 17 Jan 2011 05:43

Re: Select max cpu usage for process

05 Mar 2015 12:22

Absol wrote:
select the maximum CPU usage for process.
Define "Select maximum" - Limit the maximum or show the maximum?
 
Absol
Member
Posts: 18
Joined: 09 Sep 2013 12:57
OS: Windows 7 32bit

Re: Select max cpu usage for process

05 Mar 2015 12:26

limit

fo example select skype.exe and set limit CPU to 5%
 
User avatar
TETYYS
Contributor
Posts: 515
Joined: 23 Apr 2013 10:37
OS: Win 10 x64

Re: Select max cpu usage for process

05 Mar 2015 16:53

I think that would require modification of Windows kernel.
 
User avatar
dmex
Admin
Posts: 1695
Joined: 17 Jan 2011 05:43

Re: Select max cpu usage for process

06 Mar 2015 00:33

Absol wrote:
select skype.exe and set limit CPU to 5%
You can't limit the maximum CPU for a process. You could suspend the process when it reaches the limit but the second you resume it would go over the limit again :?
 
Absol
Member
Posts: 18
Joined: 09 Sep 2013 12:57
OS: Windows 7 32bit

Re: Select max cpu usage for process

08 Mar 2015 13:42

Is it possible to make the process of thinking that the processor is slower than it actually is?
 
User avatar
dmex
Admin
Posts: 1695
Joined: 17 Jan 2011 05:43

Re: Select max cpu usage for process

08 Mar 2015 23:42

Absol wrote:
Is it possible to make the process of thinking that the processor is slower than it actually is?
No. You can however specify the process Affinity for limiting the number of cores its able to utilize?

For example; If you limited the process to 1 core on a quad-core (4) system the process would only be able to utilize 25% of the processor.

Image

2 core processor = 50% utilization per core
4 core processor = 25% utilization per core
6 core processor = 16.6% utilization per core
8 core processor = 12.5% utilization per core
10 core processor = 10% utilization per core
12 core processor = 8.3% utilization per core

If you have 4 cores - each one has a maximum 25% utilization of 100% - If you limit the process to two cores it can only utilize 50% at maximum.
If you have 12 cores - each one has a maximum 8.3% utilization of 100% - If you limit the process to two cores it can only utilize 16.6% at maximum.

Hopefully that makes sense?
 
Absol
Member
Posts: 18
Joined: 09 Sep 2013 12:57
OS: Windows 7 32bit

Re: Select max cpu usage for process

11 Mar 2015 20:45

If one core cpu ? )) This not working! :)
 
User avatar
TETYYS
Contributor
Posts: 515
Joined: 23 Apr 2013 10:37
OS: Win 10 x64

Re: Select max cpu usage for process

12 Mar 2015 08:39

And it will not work, you are asking for impossible.
 
User avatar
TETYYS
Contributor
Posts: 515
Joined: 23 Apr 2013 10:37
OS: Win 10 x64

Re: Select max cpu usage for process

10 Oct 2017 18:00

Seems like from Win8 you can set CPU rate cap? https://github.com/zodiacon/WindowsInte ... uLimit.cpp
 
User avatar
dmex
Admin
Posts: 1695
Joined: 17 Jan 2011 05:43

Re: Select max cpu usage for process

11 Oct 2017 02:33

TETYYS wrote: 10 Oct 2017 18:00
Seems like from Win8 you can set CPU rate cap? https://github.com/zodiacon/WindowsInte ... uLimit.cpp
Until Windows 8.1 a process can only be associated with a single job and the bulk of Process Hacker users are using Windows 7.

You should be able to set the CpuRateLimit on every OS using NtSetInformationProcess -> ProcessQuotaLimits class -> QUOTA_LIMITS_EX -> CpuRateLimit ??
 
User avatar
diversenok
Contributor
Posts: 49
Joined: 26 Jun 2017 17:55
OS: Windows 7 x64
Contact:

Re: Select max cpu usage for process

14 Oct 2017 15:30

dmex wrote: 11 Oct 2017 02:33
You should be able to set the CpuRateLimit on every OS using NtSetInformationProcess -> ProcessQuotaLimits class -> QUOTA_LIMITS_EX -> CpuRateLimit ??
I've tested this idea but some strange things happened and so limitation didn't work:
NtQueryInformationProcess with ProcessQuotaLimits always returns CpuRateLimit.RateData == 100
If I change this value to any other and call NtSetInformationProcess it succeeds, but a subsequent call to NtQueryInformationProcess reveals that nothing has changed.