[mythtv-users] backend storage performance needs?

Simon Hobson linux at thehobsons.co.uk
Tue May 19 16:53:36 UTC 2020


Stephen Worthington <stephen_agent at jsw.gen.nz> wrote:

> There is no exact answer to just how many recordings at once you can
> do with one hard drive.  There are quite a number of factors to
> consider.

More of a dark art than a science :D


> And then there is the cache - a large RAM cache and a good caching
> algorithm (where the head movement is minimised) can make a big
> difference when the heads have to move away from a recording to update
> the system areas.

Doesn't Myth effectively disable caching for recordings. AIUI, the recording loop constantly writes out a chunk of data then fsyncs the file so it's written out to disk. In some ways that's terrible for performance for the reasons you cite - but it avoids the "big system cache gets full, system effectively pauses for several seconds while it's written out".
But it does mean that *as a minimum*, each recording requires two disjoint writes per second - one to write the last second (or more) of recording, the other to update the filesystem (which itself may involve more than one write).

As another data point, I have two recording drives - a 4TB WD Purple and a 3TB Toshiba. I can record something like five streams (that's the highest I generally see, usually a lot lower) while watching back another one or two - without any noticeable issues.


Some time ago (as in quite a few years) when I did have a very constrained system, I did consider playing with the caching arrangement in the recorder loop. It has a fixed ring buffer size, and writes out the data once/second. Problems happen if the hardware can't keep up, and the buffer overflows - then you lose a chunk (I suspect about the buffer size) of the recording.
I suspect that in a system with poor sync performance, making the buffer larger and lengthening the sync time would help.

Also, separating the OS & database from the recording drives make a huge difference. There's a lot of database activity - particularly at the start and end of each recording, and any time you trigger a reschedule. Splitting those made a huge difference when I was able to - having originally not had that luxury. On my new backend, I have the OS & DB on SSDs which make a great improvement.

Simon



More information about the mythtv-users mailing list