[mythtvnz] realtime scheduling of the backend?

Michael Dilger mike at mikedilger.com
Mon Mar 31 12:20:05 BST 2008


What is the best way to ensure that you don't get "Dropping data' from 
ivtv when your system gets busy?

I use my MythTV server for a lot of things, mostly MythTV and an NFS 
storage server (from xfs).   Sometimes it gets busy (gentoo emerge 
compiling, me watching a video, maybe a compile on another computer 
fighting for the filesystem's time).. and the front end
is also the same machine .... and when it gets busy I get these kernel 
messages:

Mar 29 17:59:11 [kernel] ivtv0: All encoder MPEG stream buffers are 
full. Dropping data.
Mar 29 17:59:11 [kernel] ivtv0: Cause: the application is not reading 
fast enough.
Mar 29 17:59:38 [kernel] ivtv0: All encoder VBI stream buffers are full. 
Dropping data.
Mar 29 17:59:38 [kernel] ivtv0: Cause: the application is not reading 
fast enough.

When that happens, and I go check, the recorded video has a lot of 
drop-outs and skips.

So what I want to do is tell the machine "Recording is your #1 priority, 
delay all other processes if you have to, just make sure you don't let 
that ivtv input buffer overflow!".

So I decided to look into running the recording thread with realtime 
priority, so it can be sure to read the data fast enough.  But the web 
pages I have seen so far talk only about running the FRONT end with 
realtime priority.  Is no one else concerned about not recording fast 
enough?

I went ahead and setup PAM and rlimits for a realtime group, and put 
mythtv into that group for the backend.

But I'm just wondering if anyone has any other experiences that might 
shed light on this.   Is realtime not what I want?  Is throughput better 
if it runs in a more server-esque batching way instead?   Should I 
rather lower the nice value of the mythbackend process?  Is there a 
sub-process on the backend that I should focus on instead of the entire 
mythbackend?

A few notes about the system:
* Just now upgrading from 0.20 to 0.21.
* Gentoo build, currently kernel 2.6.24, been running various previous 
builds for almost 2 years, upgrading regularly
* Almost never drops data, only when it is very busy.  But I wanna see 
if I can do better.
* Kernel tickless, HR timer, pre-empts (low latency desktop model) 
including big kernel lock preempt, all APICs on.
* I just tweaked my NFS params and mysql params based on a MythTV 
performance wiki page.   That might help.

HARDWARE:
* AMD Athlon64 3200+, on an nVidia nForce3 Ultra chipset motherboard 
from MSI
* 2GB DDR400 PC3200
* Hauppauge WinTV-PVR-150 (one analog, no DVB-anything yet--- I will 
install a NOVA-T-500 in a few weeks though for DVB-T x2)
* AGP 8x graphics (Gigabyte GV-N66256DP nvidia 6600)
* 2x SATA drives (WD3000JD-SE) 1x ATA/133 (Samsung MP0402H), DVD-ROM, DL 
DVD-RAM

-Mike




More information about the mythtvnz mailing list