Jump to content

Put a limit on the Processor usage


Recommended Posts

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?

Link to comment
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%?

Link to comment
Share on other sites

  • Moderators

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:

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.

Link to comment
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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 3 months later...

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
Link to comment
Share on other sites

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
Link to comment
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 *

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...