Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×

Permanently Set Process Priority in Windows? 125

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?"
This discussion has been archived. No new comments can be posted.

Permanently Set Process Priority in Windows?

Comments Filter:
  • start /low (Score:5, Informative)

    by teeheehee ( 12647 ) * on Tuesday September 05, 2006 @10:49AM (#16044537) Homepage
    If you check out 'help start' you can see that setting the priority of a process is pretty simple at the time of invocation.

    'start /low 3dsmax.exe' or 'start /low [program.exe]' should work for you.
  • by neonprimetime ( 528653 ) on Tuesday September 05, 2006 @10:51AM (#16044561)
    Your solution is here [prnwatch.com]
  • Wrapper (Score:5, Informative)

    by Bromskloss ( 750445 ) <auxiliary.addres ... l.com minus city> on Tuesday September 05, 2006 @10:52AM (#16044574)
    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.
  • by giorgiofr ( 887762 ) on Tuesday September 05, 2006 @10:56AM (#16044615)
    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.
  • Re:start /low (Score:2, Informative)

    by teeheehee ( 12647 ) * on Tuesday September 05, 2006 @11:00AM (#16044646) Homepage
    Having re-read your post, I'm not sure if my reply helps :P

    I had thought that SysInternals had something to do this with command line, but was unable to find it. There's this third party tool which claims to be able to change the priority of a running process, but I've never used it to vouch for it: http://www.teamcti.com/pview/prcview.htm [teamcti.com]

    Sorry for the likely helpless quick-post. I should drink coffee either before or after reading, not at the same time!
  • by flink ( 18449 ) on Tuesday September 05, 2006 @11:10AM (#16044730)
    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%.
  • by mr_rattles ( 303158 ) on Tuesday September 05, 2006 @11:21AM (#16044819) Homepage
    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.
  • Re:start /low (Score:2, Informative)

    by Tim C ( 15259 ) on Tuesday September 05, 2006 @11:30AM (#16044902)
    While that won't set it permanently, if he modifies the shortcut that might be an acceptable workaround, providing he always uses the shortcut to launch the program (so no double-clicking on associated files).
  • ProcessTamer (Score:1, Informative)

    by Anonymous Coward on Tuesday September 05, 2006 @12:17PM (#16045303)
    did u try Process Tamer [donationcoder.com] ?
    I didn't try it, but if it does what it says on the tin then this is what you want.
  • Process Lasso (Score:3, Informative)

    by johu ( 55313 ) on Tuesday September 05, 2006 @12:23PM (#16045366)
    You can do that with Process Lasso. http://www.bitsum.com/ProSuper.asp [bitsum.com]
  • Re:Thanks... (Score:3, Informative)

    by Jerf ( 17166 ) on Tuesday September 05, 2006 @12:30PM (#16045440) Journal
    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.
  • by Anonymous Coward on Tuesday September 05, 2006 @12:36PM (#16045505)
    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.
  • by gbjbaanb ( 229885 ) on Tuesday September 05, 2006 @01:56PM (#16046209)
    not really. The windows task scheduler works on the principle that every process with the same priority gets equal share of the CPU. Now, if 1 app wants 100% of the CPU then it's going to be asking for it and using as much of its time slices as it can get, other apps get the same (if they want it - obviously most apps sit there twiddling their virtual thumbs waiting for the user, the disk, the network, etc). So if 2 apps want 100% each (as when you start an app whilst another is well busy) then they will each get 50%.. and take twice as long to do whatever it was they were doing, thus appearing to slow down user responsiveness.

    Usually the foreground app (ie window) gets a little bit extra so it makes Windows *more* responsive, but again, that doesn't help you if you're waiting for an app to start (as it'll be in the background...)(you can turn this feature off if you like - system control panel to make it more server like).

    So, with the system proposed, the starting app would not start any quicker - it would still want 75% of the CPU, as would the running app. The only benefit would be that the CPU had 25% time to sit there doing nothing. If you think you could use another app while those 2 fought over their 75% CPU resources, think that the app you want to use is also limited to 75% (and assuming you make it work and not sit mostly idle) it would be grabbing CPU time away from the 2 original apps, making them slower still.

    If you want more response, give 1 app a lower priority and Windows will leave it for a while until the higher priority app goes idle. I do not recommend doing this for explorer.exe :-)

    Incidentally, Linux uses a weighted round-robin scheduler (windows uses a plain one that gives equal time to all runnign aps of the same priority) that gives less time to apps the more they use the CPU, this is probably why you feel Linux is more responsive - an interactive app will spend more of its time waiting for the user, so when it does need to do something, it is given a larger amount of time than its peers. If you use it a lot though, you'd find it gets slower over time. (so if you have a text editor and a compiler running, the text editor gets more CPU time when it wants it, but if you set the editor to do a lengthy 100% CPU task, you'd find its responsiveness was not as good when it was finished).

  • Re:start /low (Score:3, Informative)

    by SuiteSisterMary ( 123932 ) <slebrunNO@SPAMgmail.com> on Tuesday September 05, 2006 @01:57PM (#16046223) Journal

    At that rate, he should be able to edit the file type association to invoke the program itself.

  • by Grotus ( 137676 ) <rlmoser@earthli n k . net> on Tuesday September 05, 2006 @03:42PM (#16046942) Homepage
    For this particular problem, the easiest solution would be to use a startup MAXscript on your render nodes which sets the priority [scriptspot.com].

    Or you could use a rendering manager which lets you control the priority of the render nodes, like Deadline [franticfilms.com] from Frantic Films.
  • ProcessTamer (Score:2, Informative)

    by Anonymous Coward on Tuesday September 05, 2006 @05:45PM (#16047971)
    Try ProcessTamer [donationcoder.com]. 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

UNIX is hot. It's more than hot. It's steaming. It's quicksilver lightning with a laserbeam kicker. -- Michael Jay Tucker

Working...