12-10-2011
2,
0
Join Date: Dec 2011
Last Activity: 11 December 2011, 6:27 AM EST
Posts: 2
Thanks Given: 0
Thanked 0 Times in 0 Posts
Is there a way to temporarily increase the priority of cron's batch queue?
I run an application where some component periodically submits jobs into cron's batch queue via the 'batch' command.
Each of these jobs perfoms a query to retrieve some data from a database, builds up an openoffice document with that data, and submits it to a headless openoffice server to have it printed. It is important that the jobs be executed in a FIFO way to keep the documents coming out at the printer in the specific order they were submitted.
AFAIK the batch queue is given a low priority, meaning (more or less) that it will only submit the next job when the CPU is not busy. This is mostly OK with me, but at certain times when my server gets very busy, the jobs waiting in the batch queue get starved and this can eventually be very problematic. In such cases, it would be great to have an easy way to temporarily give the batch queue a higher priority to get those jobs through. Or maybe move the jobs to a higher priority queue without losing the FIFO sequence.
When I was building this in the first place, I tested submitting to the batch queue an to other queues with the 'at' command, but only the batch queue seemed to keep FIFO, so I stuck with that.
I have been looking at open 'Job scheduling' packages out there (OpenPBS, Torque, SLURM...) but these seem completely overkill for my needs (they seem to be designed to run in cluster environments, they have all kinds of fancy scheduling/sequencing/paralleling options, etc.).
I would just like to keep it as simple as possible. I run everything in just a single server, and the 'at' and 'batch' commands seemed to be exactly what I needed, except in some cases I really need to be able to change the priorities of the jobs that I have already submitted into the queue.
BTW this is all in a Linux box.