[mythtv-users] restricting mythpreviewgen?

Robert Högberg robert.hogberg at gmail.com
Tue Jan 22 19:22:36 UTC 2013


2013/1/22 Alex Williamson <alex.l.williamson at gmail.com>

> Hi all,
>
> I've setup a very cpu and memory constrained slave backend solely for
> the purpose of connecting an hdpvr to the master backend.  I'm running
> 0.25+fixes and it appears to be working well so far, until I hit the
> recorded programs page in mythweb.  At that point something decides
> it's a good mythpreviewgen target and farms out a few jobs to it.  Not
> only do these jobs take a long time to complete on this slow box, but
> they risk interfering with the backend process and causing an oom on
> the slave.


I've run into this problem also, but haven't found a good solution yet.

I found class PreviewGeneratorQueue which I thought would do exactly what I
wanted. It limits the number of simultaneous preview generation jobs to <#
CPU cores> * 2. Most preview generation inside mythtv seems to use this
class, but the code used by mythweb and the upnp server seems to spawn
mythpreviewgen processes directly.

I tried to use PreviewGeneratorQueue to also generate the upnp/mythweb
previews but I'm having trouble getting the PREVIEW_SUCCESS/PREVIEW_FAILED
callbacks back to the calling class. I think my problem is that the events
I want end up MainServer::customEvent instead of being delivered to
customEvent() of my own class. This could very well be the expected
behaviour, I don't really understand QT's event handling.

I'd appreciate some input on this. Is using PreviewGeneratorQueue a good
idea here? What would be the best way to implement this? Can I implement it
all in class Content or do I need to fetch the events in
MainServer::customEvent? Other suggestions/hints?

(My situation: I have a single backend which is quite low on RAM and CPU
cycles. When mythpreviewgen runs it seems to allocate buffers for decoding
31 video frames and for my HD content this means it will allocate almost 30
Mb of memory for generating a single preview. Browsing recordings using
mythweb or upnp can trigger preview generation for lots of recordings at
the same time and the backend then runs out of memory in a very short time)

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20130122/12501df6/attachment.html>


More information about the mythtv-users mailing list