Commandline with low process priority?

Hi

I am sending a bunch of batch files on the farm.
But these commands are executed with normal process priority.
Where is the setting to change the process priority?
I though I had seen it, but I do not find it in the worker config.

As far as I can see it’s set in the application plugin itself using the ProcessPriorityClass module and self.ProcessPriority = ProcessPriorityClass.BelowNormal.

It’s not used everywhere, including in the commandline application plugin.

you could make a copy of the DeadlineRepository10\plugins\CommandLine into DeadlineRepository10\custom\plugins\ and add this to the CommandLine.py file in there. This way if anything goes wrong you’ll be able to delete the folder to roll back.

Take a look at the plugins\Nuke\Nuke.py for an example of the process priority getting set.

Not working… :frowning:

Ok, I copied the folder to DeadlineRepository10\custom\plugins\CommandLine\

Then added this to the header
from System.Diagnostics import ProcessStartInfo, Process, ProcessPriorityClass
And this to the function def InitializeProcess()
self.ProcessPriority = ProcessPriorityClass.BelowNormal

Restarted the worker service.

But the task manager still tells me the process Priority is “Normal”

When you’ve submitted the job, is it with ‘execute in shell’ enabled or not? The commandline plugin will run processes in two ways one as what we call a managed process, and the other directly.

It could be that you’ve got your change in the wrong code path, try toggling the option to see if that’s the case before doing more troubleshooting.

‘execute in shell’ enabled

I used a commandline submission, so probably using the default
“C:\Program Files\Thinkbox\Deadline10\bin\deadlinecommand” -SubmitCommandLineJob -executable \fileserver\Projects_RenderTests\batchBenchmark\render_1x10m.bat -frames 1-100 -chunksize 5 -prop BatchName=%OverrideProject% -prop UserName=%OverrideUserName%

If I open the job properties, then “Excute in Shell” is disabled.

And I have checked the .py file.
It is in the first class, which is NOT shell.
class CommandLinePlugin( DeadlinePlugin ):

def InitializeProcess( self ):
self.ProcessPriority = ProcessPriorityClass.BelowNormal

Figured it out - ProcessPriority is only a property of ManagedProcess objects, so you’ve got to be running the process with ‘Execute in Shell’ so a ManagedProcess is used instead of just a DeadlinePlugin.

You’ll need to use the Monitor submitter to create your commandline job, or enable the option in a manual job submission workflow.

The change would be within

class ShellManagedProcess( ManagedProcess ):
...
    def InitializeProcess( self ):

around line 178.

I will try that.

So what are the advantages of these “Managed Process”?
Or the issues?
I assume you would not keep both if one is way better.

The commandline plugin is a bit goofy in setup - a more regular plugin wouldn’t have both options within it. In other plugins managed processes are used when we’re not running the process directly from the Worker. Instead we’re starting it off on it’s own and feeding it input and collecting output.

In Nuke we use it as we start Nuke in what they call ‘terminal mode’ and feed it the script. This saves us having to re-open Nuke.

The advantage for you here is the started process isn’t inheriting the priority of the Worker.