[mythtv] file checks in HandleQueryRecordings

Tony Lill ajlill at ajlc.waterloo.on.ca
Fri Nov 24 17:33:39 UTC 2006


Chris Pinkham <cpinkham at bc2va.org> writes:

> * On Wed Nov 22, 2006 at 01:48:17PM -0500, Tony Lill wrote:
>> What is the purpose of checking for the existence of the recording file
>> in the main loop of HandleQueryRecordings? In my setup, this has the
>> unfortunate effect of mounting nfs partitions and spinning up disks that
>> don't need to be spun up. This contributes to the huge delay in getting
>> the watch recording screen to display, as well as making my attempts to
>> spin down idle disks pointless.
>
> If you're running current SVN, the delay should be much shorter than it
> used to be because the frontend will cache the list in most cases instead
> of re-retrieving it from the master backend.  The recordings list cache
> has been in SVN for a few months now I think.  It made a lot of actions
> on the Watch Recordings screen much quicker.

Something that I've done (besides commenting out the file checks) is
to let the frontend send an additional WHERE clause to the backend for
the QUERY_RECORDING message. It seems stupid to suck down info for a
thousand programs when you're going to ignore most of them. Between
the two changes, the time to display the results has dropped from a
minute to instantaneous, so, like, an easy 100x speedup. I can send
you the patch if you like, it's pretty simple and backwards compatible
(protocol wise). Don't know which change contributed more to the
speedup, though.

>
> This part of the code in HandleQueryRecordings has been mostly
> rewritten as part of my Storage Groups patch, and the new method doesn't
> check for the file.  The main reason for checking was the
> MasterBackendOverride setting which allows the master to stream files
> for slaves if it has access to the file locally.  In my code, I've
> pushed that check off until later because it doesn't sense to check
> for every file when very few (possibly none) will be acted on by this
> filling of the recordings list.  If the player decides to play a file
> and MasterBackendOverride is turned on, then GetPlaybackURL() will ask
> the master if it can stream the file and if so the myth:// URL will
> point to the master, otherwise the myth:// URL will point to the backend
> that recorded the file.  So the file existence check is never
> done for most files unless you actually play them.  The only time it
> should occur in HandleQueryRecordings is if the filesize is 0, so that
> we can fill the size in.

Guess I have something to look forward to in 0.21!

> --
> Chris
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


More information about the mythtv-dev mailing list