[mythtv-users] Job priority within Myth's job queue

Chris Pinkham cpinkham at bc2va.org
Tue Apr 11 18:18:40 UTC 2006


* On Mon Apr 10, 2006 at 03:33:34PM -0500, G. Panula wrote:
> Is there a way to give Commercial Flagging jobs priority over 
> Transcoding jobs within Myth's job queue?

No.

> Here is the scenario...
> Front-end has the tuner card which writes to a Back-end.
> Front-end is only allowed to process jobs(e.g. commercial flagging) from 
> the queue only during the wee hours of the morning when no one is likely 
> to be watching tv.
> The Back-end processes jobs 24x7.
> "Real-time" commercial flagging is enabled.
> Commercial flagging and Transcoding are enabled for all recordings.

You didn't say how many jobs each is set to.  It sounds like you have it set
to 1, but I'm not sure.

The JobQueue processes jobs in order of their insertion time into the jobqueue
table (ie, the time they were scheduled).  If you have the Max Jobs set to one and
only one server, then all jobs will be processed sequentially in the order they were
scheduled.  If you have two servers with Max Jobs set to 1 or you have one server with
Max Jobs set to 2 or more, and you are flagging then transcoding recordings, you'd have
the following order:

* Program #1 Commflag Job starts as job #1
* Program #2 Commflag Job starts as job #2

When the commflag job for a recording finishes, then the transcoding job for that
recording would kick off.  There was a bug in 0.19 that would allow two jobs for a
recording to run at the same time on different hosts, but that is fixed in the -fixes and
head branches of SVN.

I've tossed around the idea of creating a time window setting for each job type per backend,
so you could have transcode jobs run only at night, but flagger jobs could run anytime.
Jobs would still run in the order specified above, but your flagging could run early while
CPU-intensive transcoding waited until the middle of the night.

> transcoding job first.  I think jobs are just processed on age; oldest 
> one first aka FIFO(First In First Out)

Yes.

> Ideally the commercial flagging jobs should have a higher priority than 
> transcoding job or at least an option to say do commercial flagging jobs 
> first.

I don't think I would be opposed to a patch giving jobs a priority as long as it also
got rid of the "run commflag before transcoding" option we currently have, but I'd
probably want to discuss this first before someone submitted one.  There may be other
ways to intelligently order the queue.

--
Chris


More information about the mythtv-users mailing list