locked
limit number of concurrent jobs per user RRS feed

  • Question

  • I know there are other threads on the issue by I have not found the answer anywhere.

    I have difficulties limiting the number of concurrently running jobs per user. I am using Queued scheduling mode and graceful preemption.

    It is fairly easy to put a users jobs on hold by using an activation filter with the ActivationFilterResponse set to HoldJobReleaseResourcesAllowOtherJobsToSchedule.

    However, I have trouble getting them back in a runnable state again - and in the right order.

    • If I set a short hold time (and renew the hold if the user is still using his quota of running jobs) then the hold is not necessarily released in the right order and instead the job with a hold that expires at a convenient time is executed.
    • If on the contrary I use a long hold time then I am lacking a trigger to start code that can remove the hold.

    Is there some easy way around this?

    Maybe I have misunderstood what can trigger an activation filter run:

    • Added or freed resources (the latter as a consequence of other jobs releasing resources)
    • New jobs queued
    • Jobs requesting growth
    • Jobs on hold being released
    • ...

    Is there a complete list of events available somewhere?

    Is the activation filter evaluation only triggered by these events or is there also a scheduled evaluation with certain time intervals?

    Thursday, October 15, 2015 2:46 PM

Answers

  • Activation Filter is the right approach. You might need better handle how you set the hold time.

    - In your activation filter, you need track the jobs you set for hold until. And you need always put a longer hold until time for a job with higher job ID or lower priority. Thus you have a per user job queue sorted in order of: Priority then Submission Time. You can always remove the Hold Until from the per user job queue when he has job finished.

    - If you set long hold time, you may need job event monitoring to monitor job finish/failed/cancelled event, so that you can modify the existing hold until job from the per user job queue to be released for scheduing

    Activation is triggered when the ready to scheduled job is about to be scheduled on enough available resource for running (the job in hold until will not be in the ready to schedule queue). -- Usually it is used for license available check, if no license available, the job shouldn't be run.


    Qiufang Shi

    Friday, October 16, 2015 4:10 AM

All replies

  • Activation Filter is the right approach. You might need better handle how you set the hold time.

    - In your activation filter, you need track the jobs you set for hold until. And you need always put a longer hold until time for a job with higher job ID or lower priority. Thus you have a per user job queue sorted in order of: Priority then Submission Time. You can always remove the Hold Until from the per user job queue when he has job finished.

    - If you set long hold time, you may need job event monitoring to monitor job finish/failed/cancelled event, so that you can modify the existing hold until job from the per user job queue to be released for scheduing

    Activation is triggered when the ready to scheduled job is about to be scheduled on enough available resource for running (the job in hold until will not be in the ready to schedule queue). -- Usually it is used for license available check, if no license available, the job shouldn't be run.


    Qiufang Shi

    Friday, October 16, 2015 4:10 AM
  • Thanks again for your time and efforts! I will see if I can figure out how to implement your first suggestion of creating and maintaining a sorted list of hold until times, and thus avoid a separate job event monitoring program/service.

    Friday, October 16, 2015 6:36 AM
  • Thanks for your answer! I managed to get your first suggestion to work.
    Wednesday, October 28, 2015 3:23 PM