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?"
Tom Sugar, a robotics professor at U of Arizona has done a lot of real time stuff, I think his website has something....
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
I've had good results with Priority Master in XP, with only the occaisonal issue (video card lock up once or twice). Since I've moved to Vista, though, I've not really used it - but I suppose you could write a set of VBscript or - ugh - batch files that just launch the program in whatever priority you want, and replace the entries on your desktop/start menu with shortcuts to those script/batch files?
Your solution is here
Is there a way to determine how long a process has been "busy" (hourglass icon) for a given amount of time?
I would like to be able to justify hardware upgrades by saying, "On PC #1 over a typical workday the user sees the hourglass icon X amount of time, but on new PC #2 he only sees it Y amount of time".
Thanks,
Steve
A work that expires before its copyright never enters the public domain and thus enjoys eternal copyright protection.
I googled windows priority command line and the 6th result was titled: "smallbusiness.itworld.com - Windows Tip: Launching a low priority ..."
/low /b job5.exe -i input.dat
Here's the link
Executive Summary:
It turns out there are several solutions to this problem. A simple approach is to use the start command to launch each job with Low priority as follows:
start
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
There are versions of nice and renice for windows. One set is in Cygwin--in the sh-utils package.
"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.
Google doesn't work for people anymore
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.
While we are at it, I've got a related windows admin question...
How can I pin a process into RAM and make sure that all of its pages stay resident? I don't have source either, it's a proprietary app. The system will push it out of RAM in favor of buffercache, but that is a very sub-optimal for this guy, because he always ends up paging tons of stuff back in while the user sits there for a minute or two wondering if the thing crashed or what...
When information is power, privacy is freedom.
Just change priority.c and recompile the kernel.
Oh, they don't let you do that? Sounds like your "soft"ware is a little brittle.
I've had this sig for three days.
If you've got the source to 3dsmax, there's bound to be an API like 'nice' that you can insert to drop priority.
If not, it might possibly work to rename 3dsmax.exe to 3dsmax_real.exe and write 3dsmax.bat (this depends entirely on how the code was written):
Actually, if that doesn't work, you could do basically the same thing in a C wrapper program to be called 3dsmax.exe.
--
I don't want to rule the world... I just want to be in charge of mayonnaise.
Put this in NICE3D.CMD:
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.
There's a tool called AutoIt that lets you script various things in Windows that I use to accomplish the same thing you're asking for. Basically, I have a looped script that runs on low priority in the background... whenever it sees certain applications running it changes their priority to the level I want. In some cases, it might kill one application or another depending on whether it sees certain other applications running - for instance, I used to have it set to kill all my P2P apps whenever it sees an online game start. The script can be compiled to a standalone .exe and dropped in your /HK/LM/Software/Microsoft/Windows/CurrentVersion/R un list or Startup folder, whichever you prefer. The basic structure of my script looks like this, with ProcessManager.exe being the name of the compiled script itself:
ProcessSetPriority ("ProcessManager.exe",1)
$c = 1
While $c = 1
If ProcessExists ("arbitraryApplication1.exe") Then
ProcessSetPriority ("arbitraryApplication1.exe",0)
EndIf
Sleep (30000)
Wend
Add additional entries for every additional application you want to have deprioritized to 'low' (that's what the 0 in ProcessSetPriority Means, 1 is BelowNormal, 2 is Normal and so on) and you should be good to go.
I think that's your problem. If you get an exporter for MAX and switch to a linux based render farm then people might take you seriously.
Of course the first thing I did was fire up the Performance Monitor, but I'm not really interested in CPU utilization as a metric. If the user is using 100% of the CPU but is not waiting on the computer, it's not a problem. What I really need to know is how frequently does the program "hang" while processing.
Steve
A work that expires before its copyright never enters the public domain and thus enjoys eternal copyright protection.
This is how it's done in the real world, major 3d houses demand full source code to their entire tool chain.
>Could also be used to justify a switch to a proper desktop OS that doesn't spend
>much time at all giving the user an hour glass (or similar). Sure, OS X has a beachball,
>but even on a G4 I hardly see it. Question is, what are your using doing that they get an
>hour glass at all?
Unfortunately, the application in question only runs under Windows, and changing applications is not an option.
Steve
A work that expires before its copyright never enters the public domain and thus enjoys eternal copyright protection.
Thanks for the well-written response.
My situation is this: We use CAD software to design mechanical things. On slow computers, after every command input the computer has to process the command. Obviously some commands take longer than others. When this happens, the cursor turns to an hourglass and the software will not respond to user input. If you check the Perf Monitor the program will frequently list as "Not Responding".
I don't think CPU utilization will do the trick because I believe the CPU could be 100% utilized (or nearly so) but the program not stop responding or accepting user input.
The question I'm really trying to answer is: "How long to I spend waiting on this program to respond every day". I can ask this question on two different hardware platforms and then quantitatively be able to say how much time savings ($) the new computer will provide.
Steve
A work that expires before its copyright never enters the public domain and thus enjoys eternal copyright protection.
How do you do the same thing with processor affinity
Since when did Slashdot become a technical discussion forum, in lieu of Arstechnica's forums??
did u try Process Tamer ?
I didn't try it, but if it does what it says on the tin then this is what you want.
You can do that with Process Lasso. http://www.bitsum.com/ProSuper.asp
You COULD use Backburner... Doesn't Autodesk bundle it with its latest 3DSMax shipments? And isn't it the "Autodesk De-Facto" networked rendering tool for, for example, 3D Studio Max?
Just askin...
This from a summer intern in the SCM department, where I had oh-so-many problems with the automated builds, 'specially for BackBurner...
This is my opinion. Everyone has a right to my opinion.
C:\download\batchfiles>RUNPRIO.EXE /?
/c echo Hello world!
RunPrio is copyright EnterNet Sweden 1999. All rights reserved.
Usage: runprio [-x] [-t n] []
where is one of "low", "normal", "high", "realtime"
-x : Print exit code of
-t n : Timeout after n seconds - kill the command
Example: runprio -x high cmd
at 00:00 runprio -t 600 low mybatch.bat
You can also permanently set the process affinity mask of any executable by using Imagecfg.exe off the Windows 2000 Server Resource Kit CD (or find a copy hiding out online). I used to have to do that to fix problems with Mplayer back when I ran a dual AthlonMP system and a *shudder* soundblaster card.
If your renderer doesn't have a Low Priority option already (e.g. Brazil r/s does), then Auto-It and similar methods (watching for the process) is your best bet. For those suggesting the command line options, please keep in mind that I think he is alluding to the 3dsmax process being started by a network rendering application such as the default BackBurner. There's a ton of information that gets passed back and forth that would make a command line option very difficult to write up.
d =16044826
I also see Auto-It in use at several larger studios when they're not using their in-house solutions, so I'll second the Auto-It suggestion specifically.
One thing to keep in mind with all this, though, is that Low Priority means exactly that - Low Priority. If anything else starts happening on your machine, your render will halt dead in its tracks. E.g. if you submit a 3dsmax job at low priority and a maya job at a higher priority, the max one will do zilch until the maya one finishes. In effect, you would have been -better off- submitting the two in succession because now the maya one will be rendering while the 3dsmax job is stuck doing nothing... but still owns a chunk of the RAM/etc. now not available to maya.
So if you really want to do something like this, I would suggest reading the comment and its follow-ups here instead:
http://ask.slashdot.org/comments.pl?sid=195694&ci
That way you can actually say "max, you use 33% and maya, you go use 66%". I still wouldn't recommend it, but I know it's a solution one studio in Australia went for.
The basic problem, really, is this...
Say you have a 3D graphics outfit with a renderfarm, and you use both 3dsMax and maya. Let's say you submit a network rendering job from both.
Now the 3dsMax renderer of choice - say, mental ray - sucks up 99% of the CPU on the render job, leaving the maya render job to do crap all until the 3dsMax render job is done.
So you switch the 3dsMax process to Low Priority... but now the maya render job sucks up nearly all the CPU, and the 3dsMax render job does next-to-zilch until the maya render job is done.
You could fiddle with higher/lower priorities and see if it ever balances out, but truth is that it never does. Some of these products are coded specifically to be very agressive with regards to CPU usage because most studios want their renders done yesterday.
If you could actually monitor processes and limit their CPU usage so that you could specify 3dsmax.exe to use roughly 50%, and maya.exe to use roughly 50% as well, both render jobs will progress nicely.
Not that I recommend it, as each process still eats time and more importantly the render job itself eats RAM/etc. that the other render job won't have access to. Splitting the farm up into whatever proportion and assigning the render job only to the segment of the renderfarm of interest is much more efficient even if it's a little more work to manage.
http://threadmaster.tripod.com/
Works well for throttling specific apps on our citrix farms.
Exactly. Thanks.
Steve
A work that expires before its copyright never enters the public domain and thus enjoys eternal copyright protection.
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
If you ran a second copy of Windows in virtual mode, you could maybe set that copy of windows to have a low priority. Then, inside that second Windows, run your rendering app.
It lets you set the RAM priority in windows to favour processes over disk cache, and lets you limit disk cache.
And it's too bad. If there's anyone I can't stand, it's Liberal, Creationist, gun owning, French gays on their Apple computers.
So, when you pay $20 for software, it suddenly becomes perfect? You don't have to spend any time finding it, installing it, learning to use it, etc? And it will never have bugs, break things, leave parts around after uninstall, etc, etc?
Free software costs you time. Commercial software costs you money and time. You have to add the cost of the time and the price to compare the two. You can just compare the time of one to the price of the other.
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
You're absolutely correct that OSS is never cost-free. Neither is commercial software, even if it's "free" (or pirated). The primary reason for using Free Software, or Open Source Software, is that you have reason to believe that it will be less expensive in the long run, after all costs are considered. In my experience, this generally turns out to be the case (for the problem domains addressed).
Mike
"Not an actor, but he plays one on TV."
http://threadmaster.tripod.com/
This sig under construction. Please check back later.
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.)
One problem that I'm running into quite frequently at work with our overloaded and underspecced NAS box, is that our file copies tend to be very high on CPU usage. We have an HP server with RAID 5 configured, and feeding two simultaneous feeds of streaming video over gigabit networking, we use 50% of our resources. This makes things nearly impossible to use when we need to copy in -new- material, while the old is still being sent out for broadcast. Is there any way to specifically lower priority for file copies? Explorer.exe can be set low, but again, there's the reliability and persistence issue to be dealt with.
My own pointless vanity vintage computing page
Can I disable swap and still have hibernate work after applying this patch?
But Herr Heisenberg, how does the electron know when I'm looking?
Rename 3dxmax.exe somethignelse.exe
Download yourself a copy of quickbasic. Compile a program with one line:
system ("somethingelse.exe whatever it takes to run at proper priority")
call this program 3dxmax.exe
Check with the NIC manufacturer for newer, more efficient network card drivers. Or try a new card that has a TCPIP offload engine built in.
Thanks for the tip.
The patch appears not to be malware - (always a risk when downloading from someone other than MS - and sometimes a problem from them directly!)
I applied it, restarted, turned off swap, restarted, fired up a ton of apps, then hibernated and restored without a blue screen! First time in a year I could pull that off.
Thanks for the help. (I wish the XP swap algorithm was tunable or at least was not so aggressive about swapping. Running w/o swap is a risk, too, although not too great of one.)
Regards,
Anomaly
But Herr Heisenberg, how does the electron know when I'm looking?