Permanently Set Process Priority in Windows?
Dave asks: "I have a render farm set up for 3D Studio Max. I have a Render user that runs 3dsmax.exe when it is sent jobs by the render farm server. I have tried to set the process to low when it runs, and it works. However, when the computer is finished rendering the images, and is sent a new set to render, the priority goes back to normal (program closes in between renderings). This obviously defeats the purpose of rendering an image in the background while others are still working, as you can imagine having 3dsmax.exe pegged at 100% CPU, slows down the machine tremendously. Is there anything that can be done to set the render user's instance of 3dsmax.exe permanently to low? Or is it possible to just set 3dsmax.exe to the low priority. I know there is a command line that sets any .exe to low, but that also starts the program. I would like 3dsmax.exe to be set to low either: when render launches the program, or set 3dsmax.exe to low whenever it is launched. Can anything be done?"
If you check out 'help start' you can see that setting the priority of a process is pretty simple at the time of invocation.
/low 3dsmax.exe' or 'start /low [program.exe]' should work for you.
'start
"We are not always what we seem, and hardly ever what we dream."
Schmendrick the Magician
Your solution is here
Mabye replace "3sdmax.exe" with a shellscript that runs the real "3dsmax.exe" with the correct priority. You might have to work out how the renderer gets its data, so your shellscript can make sure it isn't dropped somewhere along the way.
Swedish plasma phys. PhD student; MSc EE; knows maths, programming, electronics; finance interest; seeks opportunities
"I know there is a command line that sets any .exe to low, but that also starts the program."
Just make an alias to 3dsmax.exe that actually invokes the one-liner you are talking of. No?
Something bad is coming when people are suddenly anxious to tell the truth.
There's the whole Performance Monitor for that: you can save the value of many different parameters, such as CPU utilization, every n seconds, and generate reports based on those.
Global warming is a cube.
I don't have any answer, but am pleased to see Ask Slashdot offering up a real technical question, not just a pretext for uninformed ranting.
The hourglass is just a picture. It has no intrinsic meaning as far as the application goes. You're supposed to change the cursor to the hourglass when your program is about to do something that will cause it to cease reacting to user input. Then, after the blocking call, you change it back to a pointer. A process could be pegging the CPU and still be showing the arrow pointer because it can still respond to you (think software HD video decoding). It could also be showing an hourglass and not using any CPU or disk resources at all (like a network application waiting for the server to respond).
Assuming you're on Windows, and that by "busy", you mean how often the CPU has been in use, then go into the Processes tab of Task Manager and look at the CPU time column for PID 0 (System Idle Process). Subtract that time from system up time to get the amount of time the CPU was in use, or divide to get idle%.
If you're a programmer you could grab the source code for a utility I wrote to kill processes by name as they appear and modify it to change the priority any time the process appears. The tool is called Process Hunter Daemon. You can get the source code at my homepage (http://yakko.cs.wmich.edu/~rattles/development/wi ndows/#phunterd).
The benefit of going this route would be that it doesn't matter how someone started the 3D Studio Max executable, it would always get changed to low priority. Actually I might do the modification myself because I'm kind of digging the idea. The list of programs that ProcessHunterD looks for is configurable, you could just as easily make the priority configurable as well so you could change it to give other executables higher priority if you'd like.
Erik http://yakko.cs.wmich.edu/~rattles
I'd love to know if there's a way to limit ALL processes to a certain percentage of total CPU... say 75%. There's no reason programs should routinely be able to run up every bit of processing power.
Did you Google a little farther and find the answer to the question that was asked? The network rendering manager is spawning 3DSM, not somebody sitting at the computer. The start command won't work unless the network renderer is modified. What he needs is for Windows to always recognize that
"I like to lick butts!" by MobileTatsu-NJG (#32700246) (Score:5, Informative)
You can do that with Process Lasso. http://www.bitsum.com/ProSuper.asp
I'm by no means a windows guru, but I do know if Task Manager says the task is "not responding", that means it is no longer responding to Windows messages. The easiest way for that to happen is for the program to be single-threaded, and in the middle of a lengthy computation, thus never getting back to the message pump, which is what you're getting.
You might be able to write a relatively simple program that just periodically sends a message to the window and looks for a response; if it doesn't get it in a certain time period, it assumes it to be unresponsive. I don't know what message is best to send (I don't know if there's a "ping" message, although presumably Task Manager is doing something like that so maybe there is), but I'm sure there's something you can use.
Unfortunately, that's about as far as I can take you, except to also suggest that you don't need to whip out Visual Studio for this; any number of more pleasent languages will be able to do this, too. Python with the Win32 extensions, for instance, can send Windows messages directly with a wrapped SendMessage call.
For this particular problem, the easiest solution would be to use a startup MAXscript on your render nodes which sets the priority.
Or you could use a rendering manager which lets you control the priority of the render nodes, like Deadline from Frantic Films.
"From my cold, dead hands you damn, dirty apes!" - CH
This is a sore point for me.
m p;displaylang=en&familyid=4cbc68d2-09e1-4511-af14- 03f357180135&displaylang=en
I've got an XP box with 1.5GB RAM. Just checking Process Manager, I've got ~900MB RAM free - and less than 500MB of apps using RAM. Windows' default paging algorithm aggressively swaps LRU blocks, so regardless of whether I'm using all of my RAM (or more than 30%) I can count on windows swapping for a good amount of time during my work day - especially if I've had an application open and unused for a few hours.
Your suggestion about disabling SWAP works - application access is rather like a rocket. Good show! Except for the fact that when swap is disabled, hibernation no longer works. In fact, I have to use a RAM defragger to keep Windows from blue screening when I hibernate. I call it "hibernation roulette."
So, with windows, I have to choose whether I swap during the day, or whether I have to shut down and restart all of my applications every day. Ick.
Any suggestions about how to be able to avoid swap *and* hibernate?
FWIW, upgrading to SP2 and applying http://www.microsoft.com/downloads/details.aspx?a
didn't help.....
But Herr Heisenberg, how does the electron know when I'm looking?
Try ProcessTamer. It lets you define rules and automatically raises/lowers the priority of "misbehaving" processes. Quite a nice app, too bad it has an annoying free registration procedure (as does most of the software on that site). --CK
Now I have only had it 5 minutes so can't give an in-depth account of how it is going to behave long-term regarding stability/system resources etc. but certainly the learning curve is non-existent if you know how to use task manager.
Honestly, someone asks how to do something simple in Windows (note a closed source cost-money OS) and most of the replies divide between:
- completely igoring the problem and telling him how to _start_ a process with a given priority, duh;
- explaining how he can install cygwin and write a script himself to scan for processes and reset them to whatever priority (good luck on making that one neat and efficient in a 5-minute script;)
- reminding him that if was only using Linux he could recompile the kernel to achieve his aims (a completely irrelevant point in any case as Windows actually does expose interfaces to adjust process priorities. Recompiling the kernel is rarely the best way to achieve something if you have the option of a defined API. This is no different in Linux.)
While the one answer that points out a simple and elegant freeware utility that does the exact job requested and does it well gets flamed.(And yes they do describe it as "freeware" on their website; I suspect what they mean to mean by "free for personal use" is that they retain copyright and you can't redistribute it, I don't think they actually intend to exclude commercial use - as suggested by the lack of a way to buy it on their purchase page.)