Page 1 of 1

Slow transfer speeds to pi attached disks

Posted: Sat Jun 21, 2014 12:40 am
by justinwathen
Hi,

I have read a few forums on this but wondering if I can get a definitive answer.
I have 2 x external hard drives connected to the pi (USB2.0) via a powered external hub, the pi is connected to the network via a wireless N adaptor. The drives are ex-fat so I can read them on mac, pi, windows.
I get very slow transfer speeds when trying to transfer from my mac to the pi either via samba or ftp (not secure ftp) around 1.7mb/s read and write.
I have tested the transfer speed from pi to disk using dd and get around 7 mb/s read/write on the pi.
I have also tested the network speed not the pi by downloading files and its fine so it doesn't seem to be the adaptor/wireless link

I would be happy with 4bm/s does anyone have any suggestions on how I can improve this.
I dont want to change the file system on the disks to ext3/4 as i need to read them on my mac.

Here is where I mount the disks in stab ( the uuid's I have listed as xxx but they are the actual id's from blkid), I read that native is only for ext4 so not sure if thats actually doing anything. Disks seem to mount fine

Code: Select all

UUID=xxxx  /media/JWNAS     auto    defaults,noatime  0       0
UUID=xxxx /media/JWNAS2     auto    defaults,noatime 0       0
Below is the output of testparm for the relevant sections, I added some settings to the global section that i saw on other forums but that didn't help again not sure if thats because its exfat

Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[pi]"
Processing section "[devices]"
Processing section "[JWNAS]"
Processing section "[JWNAS2]"
Loaded services file OK.
Server role: ROLE_STANDALONE

[global]
max xmit = 65535
unix extensions = No
max open files = 65535
socket options = IPTOS_LOWDELAY TCP_NODELAY SO_KEEPALIVE
lock directory = /var/cache/samba
idmap config * : backend = tdb
max connections = 65535
use sendfile = Yes
write cache size = 2097152

[JWNAS]
path = /media/JWNAS
force user = root
read only = No

[JWNAS2]
path = /media/JWNAS2
force user = root
read only = No

It doesn't seem to be a samba issue though as I get the same speeds via ftp, I assume there is some issue in either the way I mount the disks or the file system.
If the proposes solution is to change to ext4 then whats the best way to get files from the mac to pi?

Thanks in advance

Justin

Re: Slow transfer speeds to pi attached disks

Posted: Sat Jun 21, 2014 8:36 am
by ghans
Wireless is known for lackluster performance with the Pi.
Any reason you can't use Ethernet ?

ghans

Re: Slow transfer speeds to pi attached disks

Posted: Sat Jun 21, 2014 11:27 am
by drgeoff
ghans wrote:Wireless is known for lackluster performance with the Pi.
Does it improve significantly if security (encryption) is turned off?

Re: Slow transfer speeds to pi attached disks

Posted: Sat Jun 21, 2014 2:51 pm
by ghans
I think you might be on to something there ... but i have no idea.

ghans

Re: Slow transfer speeds to pi attached disks

Posted: Sat Jun 21, 2014 2:55 pm
by mikerr
Probably the wifi

I get 8meg/sec when wired,
It drops to 2-3meg/sec over wifi (ralink rt5370)

Re: Slow transfer speeds to pi attached disks

Posted: Sat Jun 21, 2014 9:12 pm
by DougieLawson
The filesystem on the USB device has an effect too. NTFS is sloooooww, ext4 is not as slow, if you can reformat the disk as ext4 you will get some "go faster stripes".

Re: Slow transfer speeds to pi attached disks

Posted: Sun Jun 22, 2014 10:49 am
by justinwathen
Hi All,

Thanks for the feedback, I no longer believe the wireless is an issue as I just tried transferring directly to the SD card rather than USB drives and I get 4mb/s which I am happy with.
So it would seem that maybe the file system is the issue, I see ext4 is recommended but how can I read this then with my mac?

Cheers
Justin

Re: Slow transfer speeds to pi attached disks

Posted: Sun Jun 22, 2014 11:12 am
by fruitoftheloom
justinwathen wrote:Hi All,

Thanks for the feedback, I no longer believe the wireless is an issue as I just tried transferring directly to the SD card rather than USB drives and I get 4mb/s which I am happy with.
So it would seem that maybe the file system is the issue, I see ext4 is recommended but how can I read this then with my mac?

Cheers
Justin
http://osxfuse.github.io supports Ext

Re: Slow transfer speeds to pi attached disks

Posted: Sun Jun 22, 2014 1:05 pm
by bcw142
First the WiFi is half duplex which is why 4MB/Sec (that and overhead). The file system doesn't matter if your interface is the pi to samba/ftp whatever. For Flash ext2 is recommended, I generally use ext3 or ext4 on hard drives. Wired should be twice as fast as WiFi due to duplex. Wires have a transmit wire and a receive wire, WiFi has to switch between send and receive over the same frequency so it cuts the speed in half. As for overhead, serial generally uses a start bit, stop bit and 8 data bits so it takes 10 bits to send 8. The ext2/3/4 protocols are made for Linux and so it works better for Linux. The PC and MAC are using the samba/ftp or whatever protocol so the format of the hard drive doesn't matter to them, the pi is handling that part.

Re: Slow transfer speeds to pi attached disks

Posted: Mon Jun 23, 2014 12:55 am
by justinwathen
Thanks for the feedback, i get that ext3/4 is ok when using Samba but if I want to plug the drive into my mac - say to copy the data from the exfat drive to the new ext4 then I have a problem. I will take a look athttp://osxfuse.github.io. I did read something about this being a bit unstable and potentially corrupting the file system - does anyone have any feedback on that?

Re: Slow transfer speeds to pi attached disks

Posted: Mon Jun 23, 2014 9:01 am
by DougieLawson
Create two partitions on the drive. A large ext4 partition that you'll use with samba and a smaller VFAT filesystem that can be used on your Mac. When you want to copy stuff you unmount the drive on your RPi, mount it on OSX copy the stuff to the VFAT partition. Unmount on the Mac, mount both partitions on the RPi, copy over the new stuff, unmount the VFAT partition and run normally until next time.

The VFAT partition doesn't need to be much bigger than your maximum size for any single file.

Re: Slow transfer speeds to pi attached disks

Posted: Mon Jun 23, 2014 12:30 pm
by justinwathen
Ok so I have setup an ext4 drive and attached, via ftp I am getting around 3.7 mb/s but only about 2 mb/s with samba. Any ideas on why samba would be so much slower?