Sign in to follow this  
Followers 0
Iznogoud

Put a limit on the Processor usage

10 posts in this topic

Is it possible to limit an application to a specific maximum processor power?

For an example:

A dos programm running wich is waiting for a respond uses 100% of your processor power if its active.

This is because its polling your keyboard for pressed keys.

Is it possible to limit the processor power to a specific maximum with AutoIT?

Why do i want to do this:

If you run DOS programs in a Terminal Server enviroment, it will dramatically reduce your performance if multiple users are using the same DOS program.

There are some programs wich can do this, but if they can do it, why can't we do it?

Share this post


Link to post
Share on other sites



The DOS "Start" command can set priority to start a process.

AutoIt3 also does have a ProcessSetPriority() that can used to change the priority of a process.

:whistle:

Share this post


Link to post
Share on other sites

The DOS "Start" command can set priority to start a process.

AutoIt3 also does have a ProcessSetPriority() that can used to change the priority of a process.

:whistle:

Is that enough? Isnt't there a way you can set the processor power to maximum of 20%?

Share this post


Link to post
Share on other sites

Is that enough? Isnt't there a way you can set the processor power to maximum of 20%?

Sure, close it right before it hits 21% ... j/k :whistle:

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Is that enough? Isnt't there a way you can set the processor power to maximum of 20%?

Yes :whistle: . WMI also does the same priority concept.

Seems like SmOke_N's reply could be the only reality to 20% control.

Share this post


Link to post
Share on other sites

Yes :whistle: . WMI also does the same priority concept.

Seems like SmOke_N's reply could be the only reality to 20% control.

Not the only option, because Citrix has developed a way wich controls the power usage of DOS applications.

But maybe i am just retarded to think its possible to make it on your own with help of Auto IT members.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Programs I have seen where you can monitor a process by setting it at say 20%, will raise or lower the priority to roughly allow 20% mark, give or take some. That is where ProcessSetPriority() comes into it. WMI I believe may return the CPU percentage so you can script on reading the level of the process and raise or lower the priority with ProcessSetPriority().

Edited by MHz

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Process CPU:

http://www.autoitscript.com/forum/index.ph...=_Get_CPU_Usage

Func _Get_CPU_Usage($strComputer, $percent = 2, $strProcess = "")
This function is poor in averageing CPU usage (e.g. average use in last 500ms).

It is giving alternating results 0% or 100%, during the process run with average 98% CPU.

If anyone know how to set averaging time for WMI service within this function, it would be quite useful at this point.

PV.exe in quite strong in this way.

_Get CPU_Usage Tip:

Value "_Total" with the name of the process ($strProcess) is retuning total CPU usage.

Edited by novatek

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Func _Get_CPU_Usage($strComputer, $percent = 2, $strProcess = "")

This function is poor in averageing CPU usage (e.g. average use in last 500ms).

It is giving alternating results 0% or 100%, during the process run with average 98% CPU.

If anyone know how to set averaging time for WMI service within this function, it would be quite useful at this point.

Solved: http://www.autoitscript.com/forum/index.ph...c=36490&hl=

Func _ProcessGetCPU()
Edited by novatek

Share this post


Link to post
Share on other sites

Not the only option, because Citrix has developed a way wich controls the power usage of DOS applications.

But maybe i am just retarded to think its possible to make it on your own with help of Auto IT members.

yeah, but obviously you don't know that Citrix replaces "half" of the operating system. So, before you insult members here you should proof some better understanding of what you are talking about!

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0