grantonstar
Posts: 30
Joined: Sat Nov 24, 2012 1:08 pm

Poor network / file transfer performance, because of USB?

Mon Nov 26, 2012 5:38 pm

I've installed the latest Raspbian on my RPI with the intention of using it primarily as a NAS device. I've got it running Samba, NFS and also minidlna. I'm not sure why, but the pi seems to be struggling serving video via all protocols with the clients either pausing and restarting or more often exiting out of the video entirely.

I've tried the following:

* Updated firmware and kernel using rpi-update.
* Tried the smsc95xx.turbo_mode=N trick. Seemed to make network slightly slower but didn't resolve the problem.
* set vm.min_free_kbytes = 32768
* Disabled overclocking and tried various lower overclocked settings to no avail.
* Added "socket options = TCP_NODELAY SO_RCVBUF=65535 SO_SNDBUF=65535" to smb.conf
* Have tested straight file copy operations via SMB (~2.15mb/sec and NFS (2.05 mb/sec). Also notice frequently the transfer seems to pause before restarting some seconds later (which would mirror what happens when playing a video)

Also read that there can be potential issues with NTFS and other file systems as well as unpowered USB hubs. My hub and all HD's are powered and are a mix of ext3 and ext4. Am also using the latest Raspbian. I also saw somewhere that the ethernet connection is on the same usb host as the USB ports and that this might cause a problem but there doesn't seem to be a software solution to it.

I'm still not sure where the actual root problem lies. When streaming video via smb/dlna the problem occurs intermittently and can work flawlessly for many minutes (though is more of an issue with 720p and 1080p content). Likewise, long copies seem also to work though for brief periods appear to pause/stop and then re-start. While monotiring the pi with top and streaming video via minidlna I noticed the minidlna and usb-storage processes using at most a combined ~4% CPU. This remains steady and then I notice minidlna vanishing from the process list in top. A few seconds later, the video pauses and stops. During one of these tests, I also couldn't ssh in (host not found) so it makes me think this is in part to do with the network possibly dropping out. Scanning dmesg and syslog hasn't revealed anything.

I'm just about to give up and return to my old solution. If anyone has any tips it would be very appreciated. Is it worth trying Squeeze Plug or other NAS solution?

User avatar
abishur
Posts: 4498
Joined: Thu Jul 28, 2011 4:10 am
Location: USA

Re: Poor network / file transfer performance, because of USB

Mon Nov 26, 2012 6:08 pm

Sorry, just noticed something but you did say "all my hard drives" as in, you have multiple hard drives connected to the single pi?

The Ethernet is indeed making use of the same USB 2.0 bus, but I haven't seen any non-power supply related issues with using USB and ethernet for quite some time now.

If you have multiple hard drives all connected to one pi, it might be that it's creating too much USB traffic resulting in loss of data. The usb stack in general is something we're actively working on, it might be worthwhile to check out the USB redux thread over in troubleshooting.
Dear forum: Play nice ;-)

grantonstar
Posts: 30
Joined: Sat Nov 24, 2012 1:08 pm

Re: Poor network / file transfer performance, because of USB

Mon Nov 26, 2012 7:45 pm

Yeah three hard drives connected to the hub. Other than playing video there is no other operations on other disks usually. Also tested interrupt count and it peaks at about 8000 on large transfers. Any other ways I can measure usb or disk activity?

Could it be a faulty pi?

grantonstar
Posts: 30
Joined: Sat Nov 24, 2012 1:08 pm

Re: Poor network / file transfer performance, because of USB

Mon Nov 26, 2012 10:58 pm

Have rebuilt everything from the ground up and things looking a little better. After a couple of tests playing media through SMB, drop outs are less frequent. It seems to be (mostly) linked to increasing vm.min_free_kbytes to 32768 as best as I can correlate. Still early days but it looks promising.

Experienced two drop outs testing a 720p file. The first was random during playback and the second was during a seek to fast forward to the location I was last at before the stop. Looking at the syslog I see this occurring around the time of both drop outs:
[ 3819.483394] usb 1-1.3.4.3: reset high-speed USB device number 8 using dwc_otg
Is this indicative of the USB subsystem being overloaded? Would increasing vm.min_free_kbytes help? Anything else I can try?

pauland
Posts: 2
Joined: Sun Mar 17, 2013 9:43 pm

Re: Poor network / file transfer performance, because of USB

Sun Mar 17, 2013 9:47 pm

Same problem for me. Solved ?

technion
Posts: 238
Joined: Sun Dec 02, 2012 9:49 am

Re: Poor network / file transfer performance, because of USB

Sun Mar 17, 2013 10:26 pm

Same problem for me. Solved ?
Are you sure it's the same problem?

Because if it is, and you're running the latest Raspbian as of last November, the obvious is that you are five months out of date and a lot of changes have gone down involving USB since.
I would suggest first updating Raspbian, then running rpi-update.

pauland
Posts: 2
Joined: Sun Mar 17, 2013 9:43 pm

Re: Poor network / file transfer performance, because of USB

Sun Mar 17, 2013 11:16 pm

Installation, yesterday, (with raspbian 2013-02-09 version from this website)

My problem: like you>> "Also notice frequently the transfer seems to pause before restarting some seconds later (which would mirror what happens when playing a video)"
Same problem with FTP transfert, samba transfert, and while playing video.
Idem with raspbmc version...

technion
Posts: 238
Joined: Sun Dec 02, 2012 9:49 am

Re: Poor network / file transfer performance, because of USB

Mon Mar 18, 2013 1:07 am

What I was trying to get it is that if you had "the same problem", then you in fact have a problem with your update process.

Because the original poster said he ran rpi-update, by stating you have "the same" only confuses things in suggesting you ran an update and somehow ended up with a six month old kernel.

Unless you want us to continue investigating the original poster's problem, you really are better off making a new thread and telling us what YOU have a problem with.

BrianM
Posts: 8
Joined: Sat Oct 06, 2012 8:09 am

Re: Poor network / file transfer performance, because of USB

Fri Apr 19, 2013 2:50 pm

OK, I hope this is a good place to post similar Network performance issues.

I've just done a local test with a 10Gb .mkv file, with some intersting differences between local USB and via Network.

I was disappointed to be seeing poor video performance on High Bit Rate sections of video (e.g. large sections of screen occupied with movement), and had assumed it was lack of performance on the part of the Pi. (As playing this over the same network to a side-by-side PC didn't suffer the same problem.)

However, having just copied this .mkv file to a USB thumb drive and tried it proves this theory wrong. It plays perfectly well with no jutters, pausing etc.

This would strongly suggest that the Network performance of the Pi isn't what it might be?

Any thoughts? Any idea how I might monitor transfer speeds?

(I'm using the latest RASPBMC build for this.)

Thanks

Brian

Return to “Advanced users”