[mythtv-users] Storage Groups, free space, (and auto-expire?)

Brian Guilfoos mythtv at guilfoos.com
Wed Oct 24 13:19:15 UTC 2007


[Sorry for the dissertation-like length.  Being surrounded by PhDs at
work must make me more verbose.]

I have what I imagine is a common situation - I've upgraded to SVN to
get Storage Groups, and I have drives of wildly varying capacities
(100GB, 500GB, and 1500GB).  To make matters slightly more concerning,
the drive local to the master backend (and thus used most heavily in
recording) happens to be the smallest drive, which should then fill up
quickly.

Curious as to how that would effect drive usage and auto-expire, I
decided to look at the code (since the answer wasn't in the archives),
and I learned a few things about how a drive is selected for a
recording.  I wanted to document this here for other users, and because
I believe there is a potential performance issue in situations similar
to mine.

As documented on the Wiki (
http://www.mythtv.org/wiki/index.php/Storage_Groups_Weighting ), there
is a weighting algorithm in Scheduler::FillRecordingDir() that
calculates which drive is optimal performance wise to record to.  What
isn't documented there is how free space on the drive is taken into
account.  The scheduler will attempt to place the recording on the
"best" drive according to the weighting algorithm that has enough
estimated space for the recording based on the recording length and the
maximum bitrate for that tuner.  If there is no drive with enough space,
then the "best" drive is chosen regardless, and something will have to
be auto-expired from that drive to make space - *** which is not
necessarily the oldest or lowest priority recording *** !

Now, I believe this is pretty much the best way of choosing where to
store the recording.  Perhaps the "all drives are out of space"
condition might choose a drive based on what would be expired, but that
starts to get complicated - and really isn't the aim of this post.

My concern is that the local drive - my smallest - will fill rapidly and
then be effectively "removed" from the storage group for recording
purposes.  It seems that a utility to balance free space in storage
groups might be useful - something to move older recordings from a
fuller filesystem to one with more space - to allow the scheduler to use
all available drives in a Storage Group.

Thoughts?  Does anyone else see a potential utility in something like
this?  I've got enough storage space that the auto-expire problem is a
long way off (and thus not a major concern).  But keeping the local
drive available for recordings /is/ a concern of mine, so I'm willing to
work on a general-purpose solution if other people could utilize my work.


More information about the mythtv-users mailing list