[mythtv-users] Streaming better than NFS
Brian Foddy
bfoddy at visi.com
Thu Apr 3 03:06:38 UTC 2008
On Wednesday 02 April 2008, Bruce Markey wrote:
> Brian Foddy wrote:
> > Playing this weekend, I found the AlwaysStreamFiles setting, and even
> > tho my FE has the single filesystem NFS always mounted, I decided to
> > try it. Partly, because I felt it might transfer some cpu load to
> > the BE, and the files are all local on the BE.
> >
> > I found skipping, FF to be much more responsive than with NFS.
>
> Correct.
>
> > Overall FE cpu load was also lower. Very little jitter after a FF
> > that used to happen for a few seconds while it cached up the new
> > location.
>
> Yep.
>
> > Just thought it was interesting, and people may want to try it for
> > themselves.
>
> An unstated assumption is the illusion that NFS looks like
> files are local so it must be magic somehow. An application
> opening a network connection must be clunky, inefficient and
> not magic. However, the speed that data can be sent over an
> IP network is the same whether the connection is set up by
> NFS code or MythTV code. The difference is that an application
> can be aware of that application's needs whereas NFS cannot.
> The myth network connection has to be more efficient unless
> we are doing something wrong.
>
> The myth protocol reads are aware of this application's needs
> and can adjust the read size on the fly and this is important
> for mixing FF and normal playback.
>
> http://cvs.mythtv.org/trac/changeset/11834
>
> Starting with small reads after each seek is efficient for FF
> so that we don't request excessive data when we only need to
> show one frame then seek to a new position in the file to show
> another frame. When playback continues, the read size is adjusted
> for efficiency whether it is a 160x240 analog recording up to
> a 7.2GB/hr HDTV file.
>
> NFS knows nothing of this and always uses the same blocksizes
> and read ahead policies. This means that it will send too much
> data for each frame while fast forwarding and lots of relatively
> small packets (no matter what the video bitrate) during normal
> playback.
>
> If someone has enough network bandwidth and average size files,
> NFS may work just fine and it may not be noticeable that a myth
> backend connection would be more efficient. However, if you watch
> HD over a wireless network (like me) you really want to connect
> to the backend and not rely on NFS.
>
> -- bjm
I agree a direct socket connection should be more efficient, until this
weekend, I've used NFS primarily for 2 reasons:
1. Its easy and the default.
2. There is a little insurance should the mythbackend crash while watching a
show;
but crashes are pretty few-and-far between. So far the improvements have
been noticeable, at least over my NFS params.
Brian
More information about the mythtv-users
mailing list