razorwing
Posts: 1
Joined: Fri Jun 20, 2014 2:13 pm

Re: Samba Performance

Fri Jun 20, 2014 3:22 pm

I dont have an issue with the write speed but the reliability with write speed. Can anyone confirm if the below image is normal when transferring a file from Windows to the Pi:
Capture.PNG
Capture.PNG (10.23 KiB) Viewed 7065 times
Whilst transferring a 1GB file, it drops from 10MB/s to around 1.3MB/s and repeats every few seconds. Whilst 10MB/s is an acceptable peak write speed, I am unsure why it cannot be sustained during the complete transfer.

Here is some info which might explain my setup:
Raspberry Pi Model B (Revision 2)
2GB USB Stick (11.1MB/s Write / 20.1MB/s Read / EXT4 Formatted) - Used for testing only
Raspberry Pi and Windows PC connected via Gigabit Switch within 1 meter of each other
Latest Raspbian Image used
All updates performed (sudo apt-get update, sudo apt-get upgrade, sudo rpi-update)
Samba Installed with the below settings:
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
write cache size = 2097152
getwd cache = yes
min receivefile size = 16384

Read performance is a little poor but is stable:
Capture2.PNG
Capture2.PNG (9.01 KiB) Viewed 7065 times
Is there anyway to improve the read speed?

Nameuser
Posts: 4
Joined: Wed Mar 18, 2015 7:03 pm

Re: Samba Performance

Thu Mar 19, 2015 10:38 pm

My samba read speed is also poor at 5MB/s. This is on pidora with samba4 and a ramdisk mounted in samba (mount ramfs -t ramfs /ramdisktest + chmod 777 /ramdisktest + write a 64MB file + share in smb.conf + delete after). The smb.conf settings have no effect except slowing down more. Had problems where samba4 on pidora didn't honor old smb.conf settings.

Was waiting for raspbian jessie. Now realizing that jessie will have samba4 (wheezy had samba3).

pgsyogi
Posts: 14
Joined: Tue Mar 17, 2015 8:18 am

Re: Samba Performance

Fri Mar 20, 2015 8:33 am

~11-11,5MB/s with Ext4

/dev/sda1 /mnt/hdd ext4 rw,noatime 0 0

ntfs was way slower, been trying to disable jurnaling for every partition with no success tho, Ext4 for now is the best out of what i've had

Zincat
Posts: 8
Joined: Sat Jan 17, 2015 2:35 pm

Re: Samba Performance

Thu Apr 30, 2015 10:51 am

Well, I have a Pi B+ (considering now buying a Pi2...), and have an external USB HDD attached to my pi.

Transfers between the external HDD and another pc over LAN reaches 4 MB/s speed with Samba. That's quite bad when transferring big files. I also use my pi as a fileserver for the home network so... I transfer files very often.

I thought I configured it wrong or something, but it seems that's not the case. Also, when transferring, my pi CPU usage jumps to 100%. So it seems a "Samba requires too much CPU power" problem...

Questions then, is there any faster way to transfer files? Tried Sftp but it was quite slow as well...

And, would a Pi2 gain me a significant speed increase?

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

Re: Samba Performance

Thu Apr 30, 2015 11:38 am

Zincat wrote:Well, I have a Pi B+ (considering now buying a Pi2...), and have an external USB HDD attached to my pi.

Transfers between the external HDD and another pc over LAN reaches 4 MB/s speed with Samba. That's quite bad when transferring big files. I also use my pi as a fileserver for the home network so... I transfer files very often.

I thought I configured it wrong or something, but it seems that's not the case. Also, when transferring, my pi CPU usage jumps to 100%. So it seems a "Samba requires too much CPU power" problem...

Questions then, is there any faster way to transfer files? Tried Sftp but it was quite slow as well...

And, would a Pi2 gain me a significant speed increase?
Yes, I'm getting 11.5 MB/sec. And only one core is used (and not running at maximum). HDD formatted as EXT4.
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

garnet2k
Posts: 17
Joined: Thu May 09, 2013 9:04 am

Re: Samba Performance

Fri Oct 09, 2015 9:08 am

gkreidl wrote:
Zincat wrote:Well, I have a Pi B+ (considering now buying a Pi2...), and have an external USB HDD attached to my pi.

Transfers between the external HDD and another pc over LAN reaches 4 MB/s speed with Samba. That's quite bad when transferring big files. I also use my pi as a fileserver for the home network so... I transfer files very often.

I thought I configured it wrong or something, but it seems that's not the case. Also, when transferring, my pi CPU usage jumps to 100%. So it seems a "Samba requires too much CPU power" problem...

Questions then, is there any faster way to transfer files? Tried Sftp but it was quite slow as well...

And, would a Pi2 gain me a significant speed increase?
Yes, I'm getting 11.5 MB/sec. And only one core is used (and not running at maximum). HDD formatted as EXT4.
I guess the pi is connected by 100Mb/s cable to a router. So it seems you max out the capacity of the cable - I havent seen that is real life. For me it was always 100/10 = 10 MB/s max, rather than 100/8

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

Re: Samba Performance

Fri Oct 09, 2015 11:55 am

garnet2k wrote:
I guess the pi is connected by 100Mb/s cable to a router. So it seems you max out the capacity of the cable - I havent seen that is real life. For me it was always 100/10 = 10 MB/s max, rather than 100/8
Think binary.
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

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

Re: Samba Performance

Thu Dec 03, 2015 11:01 pm

Setup a new samba server on a pi2 and found reads max out the interface at 11.5meg/sec,
but writes were still around 4meg/sec

one change:

add

Code: Select all

smsc95xx.turbo_mode=N
to the end of /boot/cmdline.txt

and now I have 8-9meg/sec writes :)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

revamped
Posts: 1
Joined: Fri Feb 26, 2016 11:40 pm

Re: Samba Performance

Sat Feb 27, 2016 12:07 am

Has anyone run into or solved razorwing's problem above, post from June/2014? His post seems to have been ignored. I am trying to solve the exact same problem, my file transfer graph looks just like his. I get over 11.5 MB/s max transfer speed, but I get constant drop in data transfer rate, seems to ground to a halt sometimes for up to a few seconds, then comes back up to the maximum speed. This is making my raspberry unusable as a file server, some applications hanging for long periods of time when accessing data, 11MB/s should be more than fast enough.

-Ben

(Also note, I get moderately worse performance when adding the following line to smb.conf. My transfer speeds drop from ~11.5MB/s to ~10MB/s: socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536)

Drake2007
Posts: 2
Joined: Sun Mar 27, 2016 8:32 pm

Re: Samba Performance

Sun Mar 27, 2016 9:14 pm

I came across this thread while researching a related issue when moving files between two hard drives seemed extremely slow.
Both drives are mounted NTFS-3g,
After tweaking /etc/fstab and adding the noatime option the drives now perform as follows:

Code: Select all

 sudo hdparm -Tt /dev/sda

/dev/sda:
 Timing cached reads:   464 MB in  2.01 seconds = 231.41 MB/sec
 Timing buffered disk reads:  78 MB in  3.09 seconds =  25.28 MB/sec
without the noatime option they were considerably worse than that.

I don't really want to nuke all my data to format to ext4 so now going forward, any more ideas to increase their speeds?

Update: I've decided to reformat one of the drives to ext4 backing up with my linux box, other will be left ntfs so I have a "gateway" drive between other Windows PC's.

I'm considering upgrading ntfs and fuse drivers to latest version would mean compiling from source but would like to know if
this would be worth all of the effort? There seems to be little info or benchmarks comparing driver versions.

Code: Select all

ntfntfs-3g --version
ntfs-3g 2014.2.15AR.2 integrated FUSE 28s-3g --version
ntfs-3g 2014.2.15AR.2 integrated FUSE 28
The latest stable version is ntfs-3g_ntfsprogs-2016.2.22
Last edited by Drake2007 on Mon Mar 28, 2016 7:11 am, edited 1 time in total.

User avatar
DougieLawson
Posts: 35339
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Samba Performance

Mon Mar 28, 2016 7:03 am

Plug your drives into a Windows machine and use that. Linux and NTFS are always going to be awful because the driver isn't embedded in the kernel, it runs in userspace.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Drake2007
Posts: 2
Joined: Sun Mar 27, 2016 8:32 pm

Re: Samba Performance

Mon Mar 28, 2016 7:33 am

DougieLawson wrote:Plug your drives into a Windows machine and use that. Linux and NTFS are always going to be awful because the driver isn't embedded in the kernel, it runs in userspace.
Yep, I've basically come to that same conclusion.

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

Re: Samba Performance

Tue Mar 29, 2016 10:23 am

New Raspberry Pi 3 on its built in wifi - around 5 meg/sec:

Writing to Pi from PC:
Image

Reading from Pi to PC:
Image

- thats a little better than my edimax usb wifi which manages around 3.5meg/sec

Wired ethernet is a flat 11.5MB both ways.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

ngoonee
Posts: 1
Joined: Mon Apr 18, 2016 7:14 am

Re: Samba Performance

Mon Apr 18, 2016 7:25 am

mikerr wrote:New Raspberry Pi 3 on its built in wifi - around 5 meg/sec:

Writing to Pi from PC:
Image

Reading from Pi to PC:
Image

- thats a little better than my edimax usb wifi which manages around 3.5meg/sec

Wired ethernet is a flat 11.5MB both ways.
Thanks for that, looks like the bottleneck is wifi speed in this case?

Mobalized
Posts: 16
Joined: Sun Jan 31, 2016 11:35 pm

Re: Samba Performance

Thu Oct 06, 2016 1:06 am

I see lots of people with Samba working great (or great by my standards at least). My experience however has been quite the opposite. I am having lots of issues with transfer rates and I've tried ext4, fat32, and NTFS and my performance is nearly identical on each. I have tried ethernet and wifi and again virtually identical. I am seeing speeds peak in the first 30 seconds or so of a transfer at between 2 and 3 MB/s and then they drop right off to a rapid fluctuation between 700 KB/s and 350 KB/s. It does the exact same thing for read and write, and I am not seeing anything in top aside from a high system load. Cpu usage seems low to me. Does anyone have any thoughts? (Pi2, clean Jessie image)

I just noticed that my speed drops when ntfs.mount goes from state S to D. Any ideas what this correlation might mean?
Attachments
Capture1.PNG
Capture1.PNG (20.52 KiB) Viewed 3770 times
Untitled.png
Untitled.png (9.95 KiB) Viewed 3771 times

Mobalized
Posts: 16
Joined: Sun Jan 31, 2016 11:35 pm

Re: Samba Performance

Fri Oct 07, 2016 7:10 pm

Just a follow up to my issue. I figured it out after a week of trying things with the network and the raspberry pi. It turns out it was the usb hub all along. I plugged it into my computer and was only getting 1MB/s max speed with errors about insufficient power as well (even though its a 2.1A hub). I'm pretty sure it was also usb 1.1. New hub and the speed issue seems to be resolved. Running at a pretty consistent 1-2MB/s now which I am content with.

plexbb
Posts: 1
Joined: Sat Apr 08, 2017 5:53 am

Re: Samba Performance

Sat Apr 08, 2017 6:25 am

Enviroment Test ACWifi

- Physical
Usb Gigabit
Rpi2 Overclock 1Ghz
Tcp Optimize
Default samba.conf (not include socket option)

Do u can optimize another way?. Thanks
Attachments
2017-04-08_13-16-15.png
2017-04-08_13-16-15.png (19.75 KiB) Viewed 3195 times
2017-04-08_13-00-58.png
2017-04-08_13-00-58.png (10.55 KiB) Viewed 3195 times

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

Re: Samba Performance

Mon Jun 04, 2018 1:20 pm

Old thread, but just swapped out my samba pi2 for a 3b+ with its gigabit interface:

from USB drive:
Image

from SD card:
Image

So a near doubling of performance there compared to non-gigabit pi


You can get maximum performance using a RAM drive ( default raspbian has that at /run and /dev/shm),
but only for 500MB of files due to being in RAM

Image
Android app - Raspi Card Imager - download and image SD cards - No PC required !

ejolson
Posts: 3009
Joined: Tue Mar 18, 2014 11:47 am

Re: Samba Performance

Tue Jun 05, 2018 6:04 pm

mikerr wrote:
Mon Jun 04, 2018 1:20 pm
Old thread, but just swapped out my samba pi2 for a 3b+ with its gigabit interface
Are those 18.1 and 21.1 MB/s numbers for read or for write? If for read, do you also have write numbers?

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

Re: Samba Performance

Wed Jun 06, 2018 1:19 pm

Writes are similar at around 20 meg/sec:

Image

but oddly the RAMdisk doesn't max out the interface on samba writes;
I expected 35 meg/sec but only got 20meg/sec, same as USB HDD:

Image
Android app - Raspi Card Imager - download and image SD cards - No PC required !

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 22658
Joined: Sat Jul 30, 2011 7:41 pm

Re: Samba Performance

Wed Jun 06, 2018 1:57 pm

I'm doing some testing at the moment. Samba share on Pi, which has a USB attached SD card, copying to a window machine using the Windows file explorer.

Getting a mostly consistent 15MB/s speed, which is 120Mbits/s. Considering this is using the USB bus to get the data off the USB/SD, AND for the Ethernet, that would indicate the bus is pushing 240Mbits/s which seems pretty OK. I normally assume you lose about 50% in overhead on USB, and 240 is exactly (and bizarrely)half the theoretical maximum of USB2

Done about 30GB so far with no issues.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “Networking and servers”