yonyonson
Posts: 3
Joined: Tue Apr 14, 2015 9:09 pm

Where is the bottleneck?

Tue Apr 14, 2015 9:11 pm

Hi all,

I've got my pi2 recently to make a seedbox/streambox/whatever out of it. So I hooked up my HDD (Transcend StoreJet 25H3, USB 3.0) to use it as a NAS using samba.

Setup is: HDD is connected to pi2 by usb, pi is connected to router (pretty old ASUS WL-500gP V2) by ethernet, and data is accessed from win7 (on ASUS Zenbook UX32VD) using SMB. Commands on pi are executed via putty and Im using raspbian os installed on class 10 16gb sd card.

I have no problem with detecting data on win, however, the speed is ridiculously low. When I try to transfer a file it does that at around 40KB/s. It is getting so absurd that I have to stop rtorrent to listen to music otherwise it just cant play mp3 properly.

So naturally I was thinking its my old router's fault. But before changing it I decided to run a series of tests to find out the actual speed between pi and hdd (maybe it was pi's lack of ram or whatever?). But both hdparm and dd showed decent results: around 8MB/s writing speed and about 14MB/s reading speed.

So to try it out i decided to make a backup of raspbian on the above-mentioned hdd and... it was slow as hell. I left it for more than 24 hours and it backed up only about 2gb, at that point I've aborted the process. If the writing speed was really 8mb/s backing up 16gb system would have taken around half an hour.

So my question is: if there's no wireless mediator between hdd and pi (its connected directly to pi's usb port) but the writing process is still extremely slow, then where is the bottleneck?

P.S. I have read a number of discussions here and elsewhere, but the main explanation is poor speed due to wireless connection, but I dont see a wireless problem here.

P.P.S. Im really new to linux and raspbian, so I might be missing smth obvious. Any help would be appreciated.
Last edited by yonyonson on Tue Apr 14, 2015 11:48 pm, edited 1 time in total.

User avatar
mikronauts
Posts: 2783
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Where is the bottleneck?

Tue Apr 14, 2015 11:19 pm

See http://www.mikronauts.com/raspberry-pi/ ... ent-howto/

for my wired results.
yonyonson wrote:Hi all,

I've got my pi2 recently to make a seedbox/streambox/whatever out of it. So I hooked up my HDD (Transcend StoreJet 25H3, USB 3.0) to use it as a NAS using samba.

Setup is: HDD is connected to pi2 by usb, pi is connected to router (pretty old ASUS WL-500gP V2) by ethernet, and data is accessed from win7 (on ASUS Zenbook UX32VD) using SMB. Commands on pi are executed via putty and Im using raspbian os installed on class 10 16gb sd card.

I have no problem with detecting data on win, however, the speed is ridiculously low. When I try to transfer a file it does that at around 40kb/s. It is getting so absurd that I have to stop rtorrent to listen to music otherwise it just cant play mp3 properly.

So naturally I was thinking its my old router's fault. But before changing it I decided to run a series of tests to find out the actual speed between pi and hdd (maybe it was pi's lack of ram or whatever?). But both hdparm and dd showed decent results: around 8Mb/s writing speed and about 14Mb/s reading speed.

So to try it out i decided to make a backup of raspbian on the above-mentioned hdd and... it was slow as hell. I left it for more than 24 hours and it backed up only about 2gb, at that point I've aborted the process. If the writing speed was really 8mb/s backing up 16gb system would have taken around half an hour.

So my question is: if there's no wireless mediator between hdd and pi (its connected directly to pi's usb port) but the writing process is still extremely slow, then where is the bottleneck?

P.S. I have read a number of discussions here and elsewhere, but the main explanation is poor speed due to wireless connection, but I dont see a wireless problem here.

P.P.S. Im really new to linux and raspbian, so I might be missing smth obvious. Any help would be appreciated.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

yonyonson
Posts: 3
Joined: Tue Apr 14, 2015 9:09 pm

Re: Where is the bottleneck?

Tue Apr 14, 2015 11:47 pm

Thanks for your article, its really helpful to understand how it all works!
However, 40KB/s is way to slow even by the standards you've described. I'd be content with ~5MB/s.
Do you know why would my setup show such low results?
mikronauts wrote:See http://www.mikronauts.com/raspberry-pi/ ... ent-howto/

for my wired results.

gkreidl
Posts: 6326
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Where is the bottleneck?

Wed Apr 15, 2015 7:19 am

My HDD transfer speed is 25-27MB/sec with an ext4 formatted HDD (connected to USB).
My Samba transfer speed is about 10 MB/sec.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

yonyonson
Posts: 3
Joined: Tue Apr 14, 2015 9:09 pm

Re: Where is the bottleneck?

Wed Apr 15, 2015 8:06 am

Mine is NTFS, you think that could be the problem?
gkreidl wrote:My HDD transfer speed is 25-27MB/sec with an ext4 formatted HDD (connected to USB).
My Samba transfer speed is about 10 MB/sec.

gkreidl
Posts: 6326
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Where is the bottleneck?

Wed Apr 15, 2015 8:19 am

yonyonson wrote:Mine is NTFS, you think that could be the problem?
NTFS is really bad for linux. You should at least install:

Code: Select all

sudo apt-get ntfs-3g
For really good performance you should format the HDD as ext4. But Windows won't be able to mount it then ....
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

User avatar
mikronauts
Posts: 2783
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Where is the bottleneck?

Wed Apr 15, 2015 3:08 pm

You are welcome!

I have seen extremely low transfer rates when:

- poor wifi connection
- terrible ethernet cable losing a lot of packets
- defective switch

Odds are it is one of the above.
yonyonson wrote:Thanks for your article, its really helpful to understand how it all works!
However, 40KB/s is way to slow even by the standards you've described. I'd be content with ~5MB/s.
Do you know why would my setup show such low results?
mikronauts wrote:See http://www.mikronauts.com/raspberry-pi/ ... ent-howto/

for my wired results.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

cpc464
Posts: 239
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: Where is the bottleneck?

Thu Apr 16, 2015 4:48 pm

So the problem is just your Pi writes to a locally connected USB drive very slowly ? You did a test from the Pi to the drive and is was 40 KB/s ?

If so try a different USB cable.
Unix engineer since 1989

Return to “Troubleshooting”