[mythtv-users] Howto prevent MythTV flushing/Syncing disk writes (LiveTV/Recordings)

Albert Graham agraham at g-b.net
Tue Mar 18 15:46:27 UTC 2008


Roger Heflin wrote:
> Albert Graham wrote:
>   
>> Hello,
>>
>> Does anyone know how to prevent MythTV from flushing/syncing every single write request when watching LiveTV or 
>> recording something.
>>
>> My machine has lots of memory and very large fast disks, so I would prefer writes to occur in much larger chunks and a 
>> lot less often, rather than every 3 or so MB.
>>
>>
>> I've set my /proc/sys/vm as follows:
>>
>> dirty_ratio = 90
>> dirty_background_ratio = 90
>> dirty_expire_centisecs = 10000
>> dirty_writeback_centisecs = 0
>> vfs_cache_pressure = 100
>> swappiness = 60
>>
>> But even after droping the caches, (so all memory is free) with drop_caches = 3, it seems to bypass the Linux caching.
>>
>> I'm using XFS over an 8 disk (7TB) hardware raid5 array (3ware 9650SE) and my write speeds are >625MB/s - uncached, so I 
>> would really like to see only a major write every 10/15 minutes, rather than the disks hammering away all day long.
>>
>> Any help would be very very much appreciated.
>>
>> Albert.
>>     
>
> Even if there are no sync calls in the application, Linux will write the data as 
> soon as is reasonable, it won't hold off a huge amount of data for a really long 
> time unless you force it to by having the input IO rate exceed the disk IO rate, 
> and then it will always be behind, and always write as much data as it can.
>
> For mythtv to do this, it would have to buffer things up itself and only write 
> every so often, and the disadvantages of this are it takes a lot of memory, and 
> more data would be lost on a unexpected crash and it would take longer to 
> shutdown things (the application buffers would have to be flushed--or lost), and 
> for most people which less capable disk subsystems it would be rather useless.
>
> You could probably make a patch to define a configurable disk buffer setup to do 
> this, but it is not going to help anything.
>
> What do you thing you are going to gain by only writing every 10-15 minutes?
>
>                          Roger
>   
Under normal circumstances I would agree with you, however, this is not 
a mission critical
 application for me nor is data integrity that important to me -  I 
mean, if I miss a show on TV
 because my server crashed, so be it - however that is very unlikely :)

My MythBox is recording 24/7 for and when I monitor the disk activity 
it's writing only 3M (max) every second that's it! and the disks are 
noisy (8 disks for myth data), so I have to listen to chung, chung, all 
day long rather than the occasional large write request every ten mins 
which I would not notice.

My point with my question is that I think MythTV is "going out of it's 
way to bypass the write cache" and secure the data to disk! maybe it's 
using O_SYNC calls I don't know, but it would be very nice to be able to 
turn this off and allow the kernel to decide when to flush - which is 
something that we can then be tuned to our own taste.

On a similar note, there is a kernel module called "ramback" which is 
still in very very early development  which  would be very nice, it 
would also solve my problem, but an option in MythTV would be better for 
everyone.

Article linke:
http://article.gmane.org/gmane.linux.kernel/651927








More information about the mythtv-users mailing list