AWS Thinkbox Discussion Forums

Concurrent Tasks & Avarage RAM Usage question

Hi!
Could you tell me, is it possible to change number of “Concurrent Tasks” according to Average RAM Usage? So, I have a job with a couple of tasks. After completion of first n tasks I calculate average of Average RAM Usage (tautology detected :slight_smile:) and decide to change it or not depend on its value. Of course i want to perform that automatically.

You might be able to do this with a post task script. The script could use ExecuteCommandAndGetOutput (thinkboxsoftware.com/deadlin … _Utilities) to call DeadlineCommand commands to get info about the current job (like the number of completed tasks). You should be able to get task info (like RAM usage) from the tasks this way as well. Then you can change the JobConcurrentTasks property of the job as necessary.

If this sounds like it might work for you, we can probably provide more info if you need it.

Cheers,

  • Ryan

I think it will work. Yes, it will be great if you provide more info about it. Look forward for your reply. Thanks!

Cool. Here’s the info on writing a post task script:
thinkboxsoftware.com/deadlin … ptingjobs/

You can use the GetJob() function to get a reference to the job object:
thinkboxsoftware.com/deadlin … _Functions

job = GetJob()

Use the JobId property to get the job ID:
thinkboxsoftware.com/deadlin … rview/#Job

Use the job ID with deadlinecommand’s “GetJob” option via ExecuteCommandAndGetOutput:

jobOutput = ClientUtils.ExecuteCommandAndGetOutput( ("GetJob", job.JobId) )

Parse this output for “TaskCount” and “CompletedChunks”, then use CompletedChunks divided by TaskCount to get the percentage of completed tasks. If it meets your threshold, use this command to get the task info for the job:

taskOutput = ClientUtils.ExecuteCommandAndGetOutput( ("GetJobTasks", job.JobId) )

Look for tasks that have “Status=Completed” and look for the “AverageRamPercentage” value. This will give you the percentage of RAM that task used. Use that info to figure out the new concurrent task setting, and then use this to update the job’s concurrent tasks:

job.JobConcurrentTasks = newConcurrentTaskValue
RepositoryUtils.SaveJob( job )

Hope this helps!

  • Ryan

Great! Thank you! It’s clear for me, so i think i’ll write this script. I’ll inform you about the result.

Hi, so sorry to dig this up again… wishing if anyone can share the full py scripts for this. Thx from a non programmer, Running on DL7 thank you!

Privacy | Site terms | Cookie preferences