Linux GPL Serialized Multi-user Batch Queue?
I am looking if anyone knows of a software solution (hopefully GPL) for a simple batch queueing system for linux.
We have a multi-user server where users submit command line script jobs, that take various amounts of time to run (seconds to days). The licensing of a commercial piece of software on the server only allows a fixed number of simultaneous jobs by all users (currently 3). Is there a simple queueing system similar to the old mainframe "batch" queue that will centrally queue user jobs, serialize the submitted jobs and then maintain a fixed number simultaneous jobs using a FIFO order. The requirements (pretty easy): GPL License, accepts jobs from multiple users, simple queue viewing and control by users (like a print queue), user permission and working directory retention (like 'at') and execution of up to a fixed number of parallel scripts/jobs. Has anyone seen or crafted a piece of software like this. Kind of a cross between a printer queue and 'at'. |
'man batch'. You already have it installed, all but certain. It launches new jobs so long as the load level's manageable, you can tune it.
|
Yes, 'batch' is installed, but it doesn't do what I need, unless there is an undocumented option. Batch looks at load levels before launching a job.
I have plenty of processor cores and memory, but only have a limited number or simultaneous licenses available for a piece of software. Failure to have a license free when launching a job causes the job to fail. This is the reason for controlling the maximum number of simultaneously running queue jobs. The rest of the software on the server has no such license restriction and wouldn't be run from this queue. Since, there are multiple users with varying job lengths, 'at' or 'cron' are not useful. I looked into 'torque' and 'nqs', but these are hugely overkill. This is running on a single, large, multi-core server, not a distributed cluster. I need something analogous to a printer queue feeding a small printer pool, but instead of printers, they would be command line shells. Any help with prebuilt software or links to people altering queues for a similar purpose would be great. |
[hang on, sorry, the answer that was here passed a smoketest but not a real test]
Okay, I thought I could make bash do it but that'll take a better man than me. So what I have instead is a set of brutally simple C programs: one to turn in a ticket for someone to use, one to get a ticket as soon as one's available, and one to collect and distribute tickets. Use them with a simple script that gets a ticket, runs a command and returns the ticket (also included below). I have tested this, corner cases and all, it's usable as-is if primitive suits your style. Code:
// llr.c, connect to the ticket-return socket so someone else can use our ticket Code:
// llg.c, get a free ticket as soon as the server has one to hand out Code:
// lla.c, collect tickets from clients connecting to the return socket Code:
#!/bin/sh |
... and here's a patch to handle people cancelling a job already waiting for a ticket
Code:
diff --git a/lla.c b/lla.c |
Wow, awesome. Thanks for your help. I was looking for pointers and now I have custom code.
|
I left some "won't happen"s in there and they just will not stop bugging me. So:
Code:
|
Hello,
The program you are looking for is Lluis Batlle i Rossell's Task Spooler for Linux (ts). It's GPL's. Grab it here: http://vicerveza.homeunix.net/~viric/soft/ts/. It has one or more job runners that process entries from a batch queue. Easy to compile. Man page: Code:
usage: ./ts [action] [-ngfmd] [-L <lab>] [cmd...] |
All times are GMT -5. The time now is 09:28 PM. |