Slashdot Mirror


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?"

6 of 125 comments (clear)

  1. start /low by teeheehee · · Score: 5, Informative

    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.

    --
    "We are not always what we seem, and hardly ever what we dream."
    Schmendrick the Magician
  2. Prio - Process Priority Saver by neonprimetime · · Score: 4, Informative

    Your solution is here

  3. Wrapper by Bromskloss · · Score: 4, Informative

    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
  4. More effective solution? by voice_of_all_reason · · Score: 4, Insightful

    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.

    1. Re:More effective solution? by gbjbaanb · · Score: 4, Informative

      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).

  5. 3DS Max Startup script by Grotus · · Score: 4, Informative

    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