[mythtv-users] ionice, nfs, mythtv, and disk usage

Keller Giacomarro keller.g at gmail.com
Fri Apr 20 20:49:17 UTC 2007


I've been playing around with ionice recently to try to prioritize which
programs get drive access first. My main goal is to allow MythTV to
still play HD video while sending other videos around on the network. As
it is now, the HD playback can't keep up with Myth's video playing
requests when more than one HD transcode is being done on a remote
backend.  Here's my setup.

MediaServer : Combined Primary BE/FE, 2 jobs at a time, Transcode and
Commflag
MediaTranscoder : Slave BE only, 3 jobs at a time, Transcode only
DatabaseServer : Slave BE only, 1 job at a time, Commflag and MySQL

The problems start to happen when MediaTranscoder tries to transcode 1
or 2 HD files while MediaServer is trying to play back an HD file.  The
hard drive simply can't keep up.  So, my thought was to use ionice to
tell the jobs to only use idle hard disk time on MediaServer.  I was
effectively able to do this for MediaServer's jobs by running
mythbackend as root and changing the command for transcode and commflag
in mythtv-setup.  They look like this...

Commflag : ionice -c 3 mythcommflag -j %JOBID% -V %VERBOSELEVEL%
Transcode : ionice -c 3 mythtranscode -j %JOBID% -V %VERBOSELEVEL% -p %
TRANSPROFILE%

So, local commflag and transcode jobs should be using idle hard drive
time only.  However, nfsd (the NFS daemon) is still running at the
normal ionice priority.  I found out how to change the nice level of
nfsd, but I can't figure out how to change the ionice level.

First, does anyone know how to change the ionice level of a service like
nfsd every time it starts?

Second, is my theory on this sound?  Am I just looking for extra
performance that isn't there or could this help playback be more
reliable while transcodes and commflags are in progress?

If this solution works, I'd like to look into coding Myth to
automagically handle some of this.  You could have mythtv re-ionice the
mythcommflag, mythtranscode, and nfsd processes whenever playback starts
and then return them to normal when playback is exited.  This would
hopefully reduce stutter and read problems due to over-taxing of the
hard disk.

Thanks for taking the time to read and for your help!

-Keller



More information about the mythtv-users mailing list