I would like to be able to limit the amount of jobs of a given "type" that run at the same time (maybe based on their label, e.g. no more than N jobs with label mylabel may run at the same time).
I have a long running computation that requires a license key to run. I have N license keys and I would like to limit the amount of simultaneously running jobs to N. Here's how I imagine it working: I label the jobs with some special tag. Then, I schedule N + K jobs, then at most N jobs may be in state "running" and K jobs should be in the queue and may only transition to "running" state when the total number of running jobs labeled mytag is less or equal to N.
[UPDATE]
- The jobs are independent of each other.
- The execution order is not important, although I would like them to be FIFO (time wise).
- The jobs are scheduled on user requests. That is, there is no fixed amount of work known in advance that needs to be processed, the requests to run a job with some set of parameters (configuration file) come sporadically in time.