justinwathen
Posts: 4
Joined: Sat Jun 21, 2014 12:09 am

Slow transfer speeds to pi attached disks

Sat Jun 21, 2014 12:40 am

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

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Slow transfer speeds to pi attached disks

Sat Jun 21, 2014 8:36 am

Wireless is known for lackluster performance with the Pi.
Any reason you can't use Ethernet ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: Slow transfer speeds to pi attached disks

Sat Jun 21, 2014 11:27 am

ghans wrote:Wireless is known for lackluster performance with the Pi.
Does it improve significantly if security (encryption) is turned off?

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Slow transfer speeds to pi attached disks

Sat Jun 21, 2014 2:51 pm

I think you might be on to something there ... but i have no idea.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

mikerr
Posts: 2825
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Slow transfer speeds to pi attached disks

Sat Jun 21, 2014 2:55 pm

Probably the wifi

I get 8meg/sec when wired,
It drops to 2-3meg/sec over wifi (ralink rt5370)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Slow transfer speeds to pi attached disks

Sat Jun 21, 2014 9:12 pm

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".
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

justinwathen
Posts: 4
Joined: Sat Jun 21, 2014 12:09 am

Re: Slow transfer speeds to pi attached disks

Sun Jun 22, 2014 10:49 am

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

fruitoftheloom
Posts: 23132
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Slow transfer speeds to pi attached disks

Sun Jun 22, 2014 11:12 am

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
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

bcw142
Posts: 8
Joined: Fri Jun 20, 2014 3:37 pm

Re: Slow transfer speeds to pi attached disks

Sun Jun 22, 2014 1:05 pm

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.

justinwathen
Posts: 4
Joined: Sat Jun 21, 2014 12:09 am

Re: Slow transfer speeds to pi attached disks

Mon Jun 23, 2014 12:55 am

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?

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Slow transfer speeds to pi attached disks

Mon Jun 23, 2014 9:01 am

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.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

justinwathen
Posts: 4
Joined: Sat Jun 21, 2014 12:09 am

Re: Slow transfer speeds to pi attached disks

Mon Jun 23, 2014 12:30 pm

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?

Return to “Troubleshooting”