Author Topic: NFS performance for user share when playing movies  (Read 6168 times)

Offline amityony

  • Member
  • **
  • Posts: 10
NFS performance for user share when playing movies
« on: January 07, 2009, 05:47:27 AM »
When I play movies using NFS share, and doing some time seek, the movie stutter, and the Unraid CPU become very high:

top - 15:32:00 up 21 min,  1 user,  load average: 1.33, 0.68, 0.45
Tasks:  81 total,   2 running,  79 sleeping,   0 stopped,   0 zombie
Cpu0  :  0.0%us,  0.0%sy,  0.0%ni, 34.7%id, 65.0%wa,  0.0%hi,  0.3%si,  0.0%st
Cpu1  :  0.0%us,  0.0%sy,  0.0%ni,  0.3%id, 99.7%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2040764k total,  1688868k used,   351896k free,     2708k buffers

You can see Cpu1 is 0% idle, and Cpu 0 is only 34 idle.

The bit rate of the movie I am testing is not that high, ~40Mbps.
It works perfect on disk share.

I am using version 4.4.2. I tried using blockdev to control the read ahead with higher and smaller number with no effect.

If you want I can collect more information.

Offline limetech

  • Administrator
  • Hero Member
  • *****
  • Posts: 4646
    • Lime Technology
Re: NFS performance for user share when playing movies
« Reply #1 on: January 07, 2009, 08:45:44 AM »
What player software are you using?  Tried this with VLC media player & can not reproduce.  I will try another player later today.

Offline bubbaQ

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3200
Re: NFS performance for user share when playing movies
« Reply #2 on: January 07, 2009, 08:54:06 AM »
What format file?  Some can not time seek, and some players are for crap and can't do it wither with some formats even if the format supports it.  The player "simulates" it by trying to do ultra-fast forward.... and that will definitely stutter.

Offline Joe L.

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 18812
Re: NFS performance for user share when playing movies
« Reply #3 on: January 07, 2009, 09:00:42 AM »
What format file?  Some can not time seek, and some players are for crap and can't do it wither with some formats even if the format supports it.  The player "simulates" it by trying to do ultra-fast forward.... and that will definitely stutter.
Ah... but he said the player works perfectly when playing the same file from a "disk" share.  It is the "user-share" that gets ties up in a knot when he seeks forward over NFS.

Joe L.

Offline bubbaQ

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3200
Re: NFS performance for user share when playing movies
« Reply #4 on: January 07, 2009, 09:19:26 AM »
True, but knowing the player, file format, codec, and bitrate would be helpful... this could be an "OK... close to the limit on one, and slightly over on the other, need some tweaking" or could be a "holy halibut Batman, there is no way that should stutter!"

Offline amityony

  • Member
  • **
  • Posts: 10
Re: NFS performance for user share when playing movies
« Reply #5 on: January 07, 2009, 01:07:02 PM »
Yes, the file plays perfect on disk share but not on user share.


The file I am playing can be downloaded from here:
http://www.w6rz.net/
under the "Elephants Dream (Open Source Movie)" section you should download all the parts and merge them together to a single file using dos:
copy /b ed24p_00.ts+ed24p_01.ts+ed24p_02.ts+ed24p_03.ts+ed24p_04.ts+ed24p_05.ts+ed24p_06.ts+ed24p_07.ts+ed24p_08.ts+ed24p_09.ts+ed24p_10.ts+ed24p_11.ts ed24p.ts

This file is a constant 40Mbps file that is similar to bluray rip rates.



I am using Popcorn hour player to play the file over nfs-tcp.

Offline bubbaQ

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3200
Re: NFS performance for user share when playing movies
« Reply #6 on: January 07, 2009, 03:03:08 PM »
I have Elephant's dream ... its on legaltorrents.com

The copy I have is MP4, 1080p, and has an average bitrate of 10.2Mbps (835MB / 10:53 length) and a peak of about 38Mbps.

Compare that to the MP2 transport stream version you linked to, and see that there is no visual difference, but a file that is much smaller, and 1/4 the average bitrate.
« Last Edit: January 07, 2009, 03:05:22 PM by bubbaQ »

Offline amityony

  • Member
  • **
  • Posts: 10
Re: NFS performance for user share when playing movies
« Reply #7 on: January 07, 2009, 04:11:53 PM »
I have Elephant's dream ... its on legaltorrents.com

The copy I have is MP4, 1080p, and has an average bitrate of 10.2Mbps (835MB / 10:53 length) and a peak of about 38Mbps.

Compare that to the MP2 transport stream version you linked to, and see that there is no visual difference, but a file that is much smaller, and 1/4 the average bitrate.


The file I linked to, at http://www.w6rz.net/ , is specifically made for high bit rate streaming testing...
This is why the file size is larger than yours. It was encoded in 40Mbps to test heavy load on the storage and player. You should expect the same video quality.

When playing bluray rips there are some scenes with high constant bit rate. This file was made to make it easier to test and demonstrate such problems.

Offline bubbaQ

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3200
Re: NFS performance for user share when playing movies
« Reply #8 on: January 07, 2009, 07:57:50 PM »
Whenever there is a stuttering or other playing issue, it would be helpful if the user was to report some information about the file.

MediaInfo is a good free applications for this:

  http://mediainfo.sourceforge.net/en

I use the CLI version in my media server interface.

Offline amityony

  • Member
  • **
  • Posts: 10
Re: NFS performance for user share when playing movies
« Reply #9 on: January 08, 2009, 04:39:53 AM »
I think I found a way to make the popcorn hour play this movie, and the bluray rips correctly from unraid !


This is what is needed:

1) For all the mdX devices set read ahead for exactly 32k (nfs normal read):
blockdev --setra 64 /dev/md1

2) Set only one nfsd
echo 1 > /proc/fs/nfs/threads

3) Set low latency settings in sysctl
sysctl -w net.ipv4.tcp_low_latency=1


I don't know exactly why it is working with this settings, but it does. It seem like a latency problem of the user share that does not happen on disk share.
It is still not 100% working when seeking in the movie, but it is much better.

Offline amityony

  • Member
  • **
  • Posts: 10
Re: NFS performance for user share when playing movies
« Reply #10 on: January 08, 2009, 07:06:05 AM »
Another thing I changed and really fix NFS performance of user share to 100% is:

edit the syslinux.cfg and change the disk elevator algorithm to "Completely Fair Queuing".


change the boot append line to this:

append elevator=cfq initrd=bzroot

Offline smino

  • Sr. Member
  • ****
  • Posts: 318
Re: NFS performance for user share when playing movies
« Reply #11 on: October 01, 2009, 09:00:25 AM »
Has anyone verified these settings? I just switched 100% to linux Mint (ubuntu with all the codecs and goodies).

Offline RobJ

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3347
  • Epox MF570 (nForce570) (A-) / Biostar nForce4 (D-)
Re: NFS performance for user share when playing movies
« Reply #12 on: October 06, 2009, 05:06:47 PM »
I would like to ask the veteran unRAID users with considerable Linux experience what they think about the settings suggested above, in particular, the elevator setting, as well as the low latency setting.  Are these valid changes for the rest of us, and if so, how do we implement them.  And are they something I should be recommending on the Improving Performance wiki page?
Need help, start here:  Troubleshooting      Questions?  Try the FAQ      Please contribute to the unRAID Wiki

Offline Joe L.

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 18812
Re: NFS performance for user share when playing movies
« Reply #13 on: October 06, 2009, 05:29:28 PM »
I would like to ask the veteran unRAID users with considerable Linux experience what they think about the settings suggested above, in particular, the elevator setting, as well as the low latency setting.  Are these valid changes for the rest of us, and if so, how do we implement them.  And are they something I should be recommending on the Improving Performance wiki page?
Easiest way to experiment is to use unMENU and this set of user-scripts.  (they are in the newest set of plug-ins)  The buttons will show up in the User-Scripts page.

With them you can set the disk I/O parameter at will just by clicking a button.
(or, since they are just shell scripts, by running any of them at the linux command line)

There is a script to get the current disk I/O method, and scripts to set it to any of those available.  Unzip to your unmenu folder that holds all your plug-in files.



Joe L.

« Last Edit: October 06, 2009, 05:33:59 PM by Joe L. »

Offline RobJ

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3347
  • Epox MF570 (nForce570) (A-) / Biostar nForce4 (D-)
Re: NFS performance for user share when playing movies
« Reply #14 on: October 06, 2009, 09:21:50 PM »
Wow, that was fast!  Nice job!

I guess I was hoping you would tell me the good and bad of the different choices.   ;)  But I suppose if I'm going to be making recommendations, it would be better to know what I'm talking about, first hand.  I'll be testing various operations under the different schedulers.  It would be good to hear from others too, as I don't use User Shares.
Need help, start here:  Troubleshooting      Questions?  Try the FAQ      Please contribute to the unRAID Wiki