tregre
Posts: 4
Joined: Mon Feb 18, 2013 8:40 pm

Re: Samba Performance

Thu Feb 21, 2013 4:33 pm

tbar wrote:
tregre wrote:I have a HDD mounted and run samba. Using dd to test write speed I get write speed of 5 MB/s and read of 19 MB/s between HDD and SD card. Using windows 8 to write to the samba share I only get 0.5 MB/s with a wait cpu of 99%. Can someone help me? Any ideas?
Have you tried the different options mentioned in earlier posts in this thread?
I have tried adding in /etc/samba/smb.conf
socket options = TCP_NODELAY SO_RCVBUF=65535 SO_SNDBUF=65535
and otherwise it is:
[usb]
comment = USB Share
path = /media/USBHDD
writeable = Yes
only guest = Yes
create mask = 0777
directory mask = 0777
browseable = Yes
public = yes

Disk is ext4 formatted with external power source. My pi has another external power source that I think is good. My /etc/fstab for the disk is:
/dev/sda1 /media/USBHDD ext4 auto,user,exec,rw,sync 0 0

tbar
Posts: 98
Joined: Thu Nov 24, 2011 6:10 am

Re: Samba Performance

Thu Feb 21, 2013 4:36 pm

Is it overclocked? Have you tried without? What OS are you using?

sakisf
Posts: 4
Joined: Mon Mar 04, 2013 10:38 am

Re: Samba Performance

Mon Mar 04, 2013 12:06 pm

I get decent performance of 7-9mb/s on my samba share with the shared usb disk formatted in xfs.

NTFS is optimal as it would allow me to move the disk to the Windows8 machine and browse locally, but since I am now using the Pi as my main torrent/smb/htpc server it doesn't matter if Win can't read it - I only use the desktop for browsing now.

My smb.conf is:

[global]
server string = RasPi
security = SHARE
map to guest = Bad User
idmap config * : backend = tdb
guest ok = Yes

[public]
comment = public
path = /mnt
read only = No
guest only = Yes

The disk is a 5400rpm Toshiba 2.5" from a broken laptop. First partition is ext4 having the rootfs then another 240gb partition with xfs where I hold the movies to be watched/stuff to be copied over to Win.

The other shared disk I have is a 2TB Seagate with 1 NTFS/1 ext3 partition of 1TB each. Copying from ext3 is about 0.5-1mb/s slower, NTFS maybe 2mb/s.

I am overclocking to 1mhz, 500core, 600sdram, overvolt of 6 and the USB/Eth controller is on Turbo mode. The Pi (B model, rev 2.0) is getting supply from a 2A charger and also from a USB Hub (output 1A) where both the disks are connected. Voltage on it is 5.00-5.02 constant.

I have noticed that when I remove the main charger and voltage drops to 4.85V I have issues receiving from the NTFS share. The smbd daemon utilizes 50% of the CPU, another 40% by the ntfs-3g driver and the transfer crawls to 1-2mb/s. ext3 goes down to 3mb/s or so. Haven't tested the xfs.

Check your voltage rate when you are doing SMB transfers, perhaps your charger is not good enough to hold a steady voltage supply and the USB/Eth bus is not getting what it needs to keep a transfer going.

Fjux
Posts: 2
Joined: Thu Mar 07, 2013 4:07 pm

Re: Samba Performance

Thu Mar 07, 2013 4:10 pm

I just tested,

My drive got a internal write speed of 10mb/s and a read around 30mb/s (tested with dd)

With samba the write speed gets up to 9 mb/s but the read (from raspberry) does not get higher then 6.5 mb/s and i would like to see that one go up to 9 aswell!

Is overclocking the only way to get that up? i already made the changes suggested in the previous posts for the smb.conf. and while reading smbd get up to 90% of my CPU.

please help!

rexel99
Posts: 4
Joined: Fri Mar 08, 2013 6:02 am

Re: Samba Performance

Fri Mar 08, 2013 6:16 am

I came here looking for an answer :-( Disappointed.

I installed the standard raspian (2013-02-09-wheezy-raspbian.zip, ntfs(3g) and exfat) and with a WD USB Drive on NTFS I am getting (dd test) 4Mb/s write speeds which is too slow.
On my Win 8 pc I can transfer 8Gig of 20Mb files from an SD card to the USB drive in about 8 or 9 minutes, on the Pi (using the same SD card, drive and hub) it takes about 50 minutes.
Overclocking the Pi has a little bit of an effect but marginal (5-10%)
NTFS (or forcing NTFS-3g) is the same.
I also tried Slackware (14) and the result was also very similar.

Doing the same dd test to an SD card (exfat ran up toward 70% too) it returned 7Mb/s write speeds.

So the NTFS (fuse etc) is using more process power than I believe is necessary, running at about 75/80% utilisation and not performing well enough with throughput.

tbar
Posts: 98
Joined: Thu Nov 24, 2011 6:10 am

Re: Samba Performance

Fri Mar 08, 2013 10:53 am

Don't use NTFS! It'll never perform under Linux as well as ext3/ext4.

rexel99
Posts: 4
Joined: Fri Mar 08, 2013 6:02 am

Re: Samba Performance

Fri Mar 08, 2013 11:23 am

tbar wrote:Don't use NTFS! It'll never perform under Linux as well as ext3/ext4.
I have to. The drive being used in the Pi will also be shared in other PC's.
The problem is that the NTFS is too slow and the issue should be resolved, using another format is not always an option and not a solution.

wpns
Posts: 85
Joined: Sat Sep 01, 2012 2:50 pm

Re: Samba Performance

Fri Mar 08, 2013 11:43 am

/*
the issue should be resolved
*/

Wait, what issue should be resolved and by who? Your $35 Linux box doesn't talk NTSF as fast as your $$$? PC? That's a statement, not a question.

nginx
Posts: 41
Joined: Sun Dec 09, 2012 2:35 pm

Re: Samba Performance

Fri Mar 08, 2013 12:13 pm

rexel99 wrote:
tbar wrote:Don't use NTFS! It'll never perform under Linux as well as ext3/ext4.
I have to. The drive being used in the Pi will also be shared in other PC's.
The problem is that the NTFS is too slow and the issue should be resolved, using another format is not always an option and not a solution.
You are expecting too much. The fact that linux even supports NTFS is something to be grateful about. M$ never even bothered to write drivers for ext4. You should complain to Microsoft to provide some sort of support for ext4.

Fjux
Posts: 2
Joined: Thu Mar 07, 2013 4:07 pm

Re: Samba Performance

Fri Mar 08, 2013 2:07 pm

rexel99 wrote:
tbar wrote:Don't use NTFS! It'll never perform under Linux as well as ext3/ext4.
I have to. The drive being used in the Pi will also be shared in other PC's.
The problem is that the NTFS is too slow and the issue should be resolved, using another format is not always an option and not a solution.
NTFS is slow and costs a lot of CPU power. you could use FAT32 i belive it is better supported on linux than NTFS. and it is supported under windows as well.

you also could format your drive 50/50 ext4 and ntfs. but then you cant share the files between windows/linux.

another possibility is useing windows as a samba server and sending it from the Pi to a windows box wich puts it on the drive, but that might not be practical.

rexel99
Posts: 4
Joined: Fri Mar 08, 2013 6:02 am

Re: Samba Performance

Fri Mar 08, 2013 9:44 pm

wpns wrote: Wait, what issue should be resolved and by who? Your $35 Linux box doesn't talk NTSF as fast as your $$$? PC? That's a statement, not a question.
Yeah, thanks... It was an example, showing that the hardware I am using does in fact provide the throughput required for higher performance.

I have seen many threads about this problem (so quite a few people have been raising it), many of the discussions question the accessories.. if it's on usb1 or a slow old hard disc.. I was just saying that for me, the hd and usb gear I am using does in fact allow file transfer much faster than the Pi is doing with NTFS. Also that while NTFS is strangely slow Fat is ok..
So why is ntfs slow and is there something that can be done about it..?
Is it the ntfs AND ntfs-3g drivers or is it based in FUSE, or the fact that these drivers use fuse...? Is it something simple that a configuration change could resolve (which is what I was hoping to find here).

Yes, while it would be nice for M$ to provide ext support and while ext is a native high speed system for linux/unix and even (ex)fat performs quite well for some reason NTFS is slow in comparison. Why is NTFS slower than exFat?

So thanks for the tips and advice so far, I am hoping that the open-source community which is larger and more agile than a closed company like M$ or Apple may be able to resolve this identified and very real problem. I am not complaining, I am just trying to contribute to the other voices also asking about this (so I ask too many questions) and was just hoping that there could be some reasonable solutions or viable explanations.

rexel99
Posts: 4
Joined: Fri Mar 08, 2013 6:02 am

Re: Samba Performance

Sat Mar 09, 2013 2:31 am

nginx wrote: You are expecting too much. The fact that linux even supports NTFS is something to be grateful about. M$ never even bothered to write drivers for ext4. You should complain to Microsoft to provide some sort of support for ext4.
Perhaps this is leading into some answers for both you and I regarding NTFS and Samba performance.. and yes it's solved with some config settings..
http://archlinuxarm.org/forum/viewtopic.php?f=18&t=5001

darragh3277
Posts: 6
Joined: Tue Mar 19, 2013 12:35 am

Re: Samba Performance

Wed Mar 20, 2013 1:27 am

Has this gotten any better? I have a RPI Samba share setup, ext4 usb stick hdd plugged into a powered USB hub which I am also using to power my RPI from. I have tried the tweaks already mentioned in this thread and I am only getting read/write speeds of between 1-2mb/s.

This is my smb.conf file. My pi is overclocked at 800MHz.

Code: Select all

Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[usb]"
Loaded services file OK.
Server role: ROLE_STANDALONE
[global]
        server string = %h server
        obey pam restrictions = Yes
        pam password change = Yes
        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        unix password sync = Yes
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65535 SO_SNDBUF=65535
        dns proxy = No
        wins support = Yes
        panic action = /usr/share/samba/panic-action %d
        idmap config * : backend = tdb

[usb]
        comment = USB Share
        path = /mnt/disk1
        read only = No
        create mask = 0777
        directory mask = 0777
        guest only = Yes
        guest ok = Yes
Model B Rev 1; 8gb Transcend Class 10;

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

Re: Samba Performance

Wed Mar 20, 2013 11:21 am

Samba and ntfs are the worst possible combination, but I have to use them because my HDDs have to be compatible with my other computers (including a Windows machine) and the same is true for samba.

Meanwhile I get a decent speed of 4.8 MB/sec for both read and write access over the network with a ntfs formatted drive. That's about 50% of what I get between my bigger machines (9 - 11 MB).

I use the following settings in samba.conf:

Code: Select all

socket options = TCP_NODELAY SO_RCVBUF=65535 SO_SNDBUF=65535 IPTOS_LOWDELAY SO_KEEPALIVE
use sendfile = yes
write cache size = 131072
The usb HDD is mounted with the following options:

sudo ntfs-3g -o noatime,big_writes /dev/sda1 /media/foldername

Without these settings I got 1.8 MB for write and about 3 MB for read access.

From my python media server on the raspi I can download files from the ntfs drive with about 5.5 MB/sec (but the cpu goes to 80% 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

sakisf
Posts: 4
Joined: Mon Mar 04, 2013 10:38 am

Re: Samba Performance

Wed Mar 20, 2013 2:31 pm

Ntfs is very cpu intensive on the pi whatever you do, there are no patches/tricks to fix that. Especially with samba which is also processor hungry, it is maxxing out processor usage even when overclocked to 1mhz and this will eventually lead to problems (pi crashing in the middle or reads/writes, overheating). The correct move under such circumstances is to format your disk to ext3/jfs/reiserfs and use it solely as a samba share, which is compatible with most systems. If you want something for compatibility with windows move to fat32 (with lack of >4gb files) but it is handled as a native format and does not have excessive memory & processor demands. In general, ntfs shall be regarded as a windows only format, unless you have a powerful linux computer, which the pi is not.

Also change the smsc95 to no turbo mode when doing samba. It will increase speeds by 1-2mb/s and you will avoid some kernel errors/panics.

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

Re: Samba Performance

Wed Mar 20, 2013 9:30 pm

sakisf wrote:...
Also change the smsc95 to no turbo mode when doing samba. It will increase speeds by 1-2mb/s and you will avoid some kernel errors/panics.
How can i do that?

No way to change the disk format, as I have lots of files > 4GB and disks must be switched between different computers.
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

tbar
Posts: 98
Joined: Thu Nov 24, 2011 6:10 am

Re: Samba Performance

Thu Mar 21, 2013 6:51 am

gkreidl wrote:
sakisf wrote:...
Also change the smsc95 to no turbo mode when doing samba. It will increase speeds by 1-2mb/s and you will avoid some kernel errors/panics.
How can i do that?
Set "smsc95xx.turbo_mode=N" in /boot/cmdline.txt.

darragh3277
Posts: 6
Joined: Tue Mar 19, 2013 12:35 am

Re: Samba Performance

Thu Mar 21, 2013 12:18 pm

Can we put together a list of things that effect the transfer rates for newbies like myself? So far as I understand it the items that affect performance.

HDD format
Hardware - Powered USB hub, short cables etc.
smb.conf file configured correctly
Overclocking the pi

What else am I missing? Can it be affected by how we mount it on the fstab? Are there any other areas that can be looked into to squeeze out more speed?
Model B Rev 1; 8gb Transcend Class 10;

loula
Posts: 1
Joined: Sat May 04, 2013 12:47 pm

Re: Samba Performance

Sat May 04, 2013 1:10 pm

I'm getting around 8 MB/s for write and around 10 MB/s for reading over Wi-Fi (802.11n) close to the router (~5 meters).

Here is my setup:
- Server: Raspberry Rev B (overclock: medium) with Wheezy (2013-02-09) - Sandisk 8GB Class 10
- Client: Dell E6320 with Windows 7 Enterprise
- Router: TP-LINK WDR3600 (with official firmware)
- External Drive: Welland (Mod. ME-580J) with 2 Seagate 2TB in RAID 1 - EXT4

My samba.conf has:

Code: Select all

socket options = TCP_NODELAY SO_RCVBUF=65535 SO_SNDBUF=65535 IPTOS_LOWDELAY
I have tried several other configurations but it seems this is the limit. For sure this is really fine.

bokobokov
Posts: 4
Joined: Sat Jun 01, 2013 9:01 pm

Re: Samba Performance

Tue Jul 09, 2013 11:55 am

I want to format my samba-powered storage under ext4 and to access it from windows 7. If I enable the read/write permissions from the samba config, will I be able to modify (write, read, delete) the drive from windows and open/play files without downloading them?

I'm quite sure the answer is no, because windows does not support ext4 and all the 3rd party software enables just read access, but I was thinking, that maybe the samba permissions could do the trick...

Regards!

RoyLongbottom
Posts: 311
Joined: Fri Apr 12, 2013 9:27 am
Location: Essex, UK
Contact: Website

Re: Samba Performance

Tue Jul 09, 2013 10:42 pm

bokobokov wrote:I want to format my samba-powered storage under ext4 and to access it from windows 7. If I enable the read/write permissions from the samba config, will I be able to modify (write, read, delete) the drive from windows and open/play files without downloading them?

I'm quite sure the answer is no, because windows does not support ext4 and all the 3rd party software enables just read access, but I was thinking, that maybe the samba permissions could do the trick...
I am converting lots of benchmarks to run on RasPi. See:

http://www.raspberrypi.org/phpBB3/viewt ... 31&t=44080

and details in:

http://www.roylongbottom.org.uk/Raspber ... hmarks.htm

The current one is for measuring speeds over LAN and WiFi between The RasPi to Linux and Windows PCs. After trying lots of proposed solutions, I can now see and change RasPi files via Windows 7 using details from the following:

http://cymplecy.wordpress.com/2012/08/0 ... chine-4-2/

You don’t have to worry about the format of remote data as this is read and written by the remote OS, not by Windows. Details of the benchmark and results should appear in my reports later this week. As usual, the source code will be available for downloading.

MightyDjinn
Posts: 18
Joined: Tue Jun 25, 2013 3:57 pm

Re: Samba Performance

Thu Jul 11, 2013 6:39 pm

My setup is as follows:

MODEM --3.2 Xeon Pfsense Router/NAT --WNDR3700v2(Switching)--Computer

----------------------------------------------------------------|
/
|
|
Powerline 500mb Wall Plug
|
|
|
WRT-310N (Switching)
|
|
|
Pi
|
1Tb Toshiba External HDD (Ext4)

I am getting 10-15Mb/s from Computer --> Pi
4-7 Mb/s from Macbook --> Pi (Via WNDR3700)
5-6 Mb/s from Xbox <-- Pi
5-6 Mb/s from Ps3 <-- Pi
3-5 Mbs/s from External (OpenVPN SSL Link via Pfsense) <-- Pi

I'm willing to bet the slowdown most are seeing is a CPU crunch from ntfs-3g overhead.

dmw
Posts: 1
Joined: Wed Sep 04, 2013 1:05 am

Re: Samba Performance

Wed Sep 04, 2013 1:07 am

Hello,

I hacked the Samsung ExFAT driver into the Raspberry Pi kernel tree. Please see various instructions and gotchas here: http://forum.stmlabs.com/showthread.php?tid=10457

radimek
Posts: 1
Joined: Sun Sep 22, 2013 9:12 pm

Re: Samba Performance

Sun Sep 22, 2013 9:14 pm

Speed - 2MB/s
100MB ethernet Pi -> WIN7.

Pi storage - USB2.0 8GB flash drive/ ext4

lederman
Posts: 1
Joined: Thu Feb 16, 2012 1:03 am

Re: Samba Performance

Tue Oct 01, 2013 12:54 pm

~# dd if=/dev/zero of=/media/USBHDD/test.tmp bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB) copied, 24.1231 s, 21.7 MB/s
~# dd if=/media/USBHDD/test.tmp of=/dev/null bs=500K count=1024
1024+0 records in
1024+0 records out
524288000 bytes (524 MB) copied, 19.6347 s, 26.7 MB/s

Return to “Networking and servers”