[mythtv-users] Control number of recording streams per Storage Group filesystem?

Chris Pinkham cpinkham at bc2va.org
Sat May 12 03:51:49 UTC 2007

* On Fri May 11, 2007 at 09:49:41AM -0700, Yeechang Lee wrote:
> However, prior experience has shown me that a certain RAID NAS I'd
> want to use can't handle more than one simultaneous HD recording
> stream. I currently have three HD-capable recording-stream sources,
> and in normal usage I know that the Storage Groups functionality would
> balance things by allocate one stream to each of my three filesystems
> (the NAS I'm asking about plus the two other RAID arrays my MythTV
> system currently uses). However, I'm going to be installing a
> HDHomeRun in the next week or so, resulting in four or five HD-capable
> stream sources. That means it's possible two or three streams could be
> sent to the NAS at once, so I'd want to put a a hard limit of no more
> than one stream to that (and only that) filesystem.

There isn't a way to explicityly say to send only X recordings at once
to a specific drive, but I think you can accomplish this with the
SGweightPerDir setting.

The Storage Groups code will prefer local drives over remote drives,
so if nothing else other than recording is going on then your first
four recordings will go to the local drivers, then the 5th would go to
the NAS drive.  If a recording was being played/flagged/transcoded on
one of the local drives, then that would give the local drive a slightly
higher weight, but still not enough to use the NAS over the local for
the first four recordings.  If 2 playback-type actions were taking place
on a drive along with a single record, then that would give that drive
enough weight to force the Storage Groups code to use the NAS device for
the 4th recording.

There is a wiki page on this I believe and I have described it in the
mailing lists a couple times, but the basic defaults are this:

starting weight of local drive = -19
starting weight of remote drive = 0

additional weight per recording = 10
additional weight per playback  = 5
additional weight per transcode = 5
additional weight per commflag  = 5

The directory with the least weight and most free space is the one that
is used for the next recording.

You can specify a weight offset for a directory by manually insertting
a setting into the settings table.  The 'value' field should be the
following format:


where HOSTNAME is the hostname of the backend and the directory is
the directory you want to apply the offset to.   This must match the
Storage Groups directory as specified in the Storage Group config.  Set
the 'data' field to the offset weight and the hostname to the hostname of
the master backend since it is the backend doing the storage scheduling.

If you wanted the NAS directory to not be used except as a last resort,
you could give it a weight offset of 20 which should be enough to force
the Storage Groups code to use the local drives for 5 recordings plus
6 playback/transcode/commflag sessions at the same time.  If you set the
value at 10, then that might be enough to make sure that you only have
one recording going to NAS because you have enough for 4 recordings
plus 4 playback/transcode/commflag sessions before the local weights
would be high enough to go above the 10 that the NAS defaults to.

I believe some people are using the SGweightPerDir offsets to setup drives
that are only used as a last resort when others fill up.  This works
because if a directory does not have enough free space for the next
recording, the Storage Groups code will skip over it in the list and
check the next directory and so on until it finds a directory that
does have enough free space even if it has the worst weight of all.


More information about the mythtv-users mailing list