Nu7s
Posts: 57
Joined: Wed Jul 25, 2012 9:14 am

Re: Samba Performance

Fri Aug 10, 2012 11:06 am

geoffreyc wrote:
Nu7s wrote:
geoffreyc wrote:Using a 1 TB USB drive (ext4), I average 8 - 9 MB/s using samba from windows (write) :)
I wonder if anyone who is reaching these speeds is willing to share their image, so I could test if it's software or hardware related?
I just run a raspbian image (pisces) with a simple apt-get install samba, but I'll share my samba config file as soon as i get home tonight.
I'm running wheezy, maybe that's the problem. I'll prepare a new SD-card with pisces and the same config tonight. But the samba config will be usefull, thanks!

scorpion_tr
Posts: 18
Joined: Wed Jul 04, 2012 1:37 pm

Re: Samba Performance

Sat Aug 11, 2012 7:49 am

Write speed to Pi (ext3).

Image

BigEndian
Posts: 19
Joined: Tue Jun 19, 2012 6:50 pm
Location: Munich // Germany

Re: Samba Performance

Sat Aug 11, 2012 1:32 pm

thanks for the screenshot @scorpion_tr


I am reaching nearly 3,9 MB/s on writing. It's just half of your performance.

What I've found out is I have a very high CPU Wait utilization:
Image

And I have nearly 10% Packet Loss if a file transfer is running:
Image

Please note there is no packet loss on idle, just during transfer.

Does anybody know the reason for the high CPU_Wait time?

I'm using the official raspbian image with most recent firmware and kernel.

TheDSider
Posts: 3
Joined: Sun Aug 05, 2012 9:59 am

Re: Samba Performance

Sat Aug 18, 2012 10:49 am

I run Wheezy, 100mbit network. My Pi has a 2TB Seagate drive attached and is running an apt-get install of Samba. I also use TeraCopy for transfers to and from the RPi. I was averaging 8.7MB/s for huge transfers (690 GB of 200-500MB files).

Then I overclocked (not by much, and I didn't overvolt) and now I'm averaging 10.4MB/s for the same files.

Pretty happy with that, but that's inline with what I'd expect from two Windows PCs or full-fledge Linux machines.

gen0
Posts: 1
Joined: Sat Aug 18, 2012 11:11 am

Re: Samba Performance

Sat Aug 18, 2012 11:22 am

I'm running a current Raspbian image, updated via apt-get and I've also updated my firmware with Hexxeh's rpi-update tool today. My Rpi has a SATA desktop drive (WD Green) connected via USB.

I have added the following line to my smb.conf:
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65535 SO_SNDBUF=65535

I get 5.4MB/sec writing to the USB hard-drive and about 6.2MB/sec reading using a desktop PC with Ubuntu Lucid as the client. While writing, my CPU shows about 57% for the smbd process in top, 85% for reading.

As an alternative to Samba I tried vsftpd but the speeds didn't seem appreciably different.

Reading/writing to my SD Card is faster - 5.7MB/sec writing 7.4MB/sec reading- so USB certainly seems to be part of the bottleneck.

I really would love to hear more from anyone who can get better performance than this as to how they did it. Once my Pi's been running stable for a couple of weeks I might try an overclock and hope for 10% better samba performance.

TheDSider
Posts: 3
Joined: Sun Aug 05, 2012 9:59 am

Re: Samba Performance

Sat Aug 18, 2012 11:49 am

gen0 wrote:I really would love to hear more from anyone who can get better performance than this as to how they did it. Once my Pi's been running stable for a couple of weeks I might try an overclock and hope for 10% better samba performance.
I don't know why my speeds are high compared to other peoples, so I'm no help :(

But I can report that my first overclock has been running stable under high load (50-70% CPU, 95% RAM and constant network and disk writes) for about 8 hours now. The changes made were:
arm_freq=800
sdram_freq=450
core_freq=400

Since all I'm doing at the moment is moving 1.5TB of data, I'm not sure if it's improved network speed or disk speed but either way, I got a decent boost in speed.

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

Re: Samba Performance

Mon Aug 20, 2012 4:39 am

I've added:
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65535 SO_SNDBUF=65535

And (arm_freq=800 was present before):
arm_freq=800
sdram_freq=450
core_freq=400

And I now get write speeds at approx 8.3 MB/s using an external USB HDD with ext4. Before the above changes it was approx 5.2 MB/s. That's a huge performance increase!

I'm also running with "smsc95xx.turbo_mode=N" in /boot/cmdline.txt and vm.min_free_kbytes = 8192 in /etc/sysctl.conf as my RPi would crash otherwise.

scorpion_tr
Posts: 18
Joined: Wed Jul 04, 2012 1:37 pm

Re: Samba Performance

Mon Aug 20, 2012 7:56 am

Are there any improvements on read speed?

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

Re: Samba Performance

Mon Aug 20, 2012 2:40 pm

tbar wrote:And I now get write speeds at approx 8.3 MB/s using an external USB HDD with ext4. Before the above changes it was approx 5.2 MB/s. That's a huge performance increase!
The above write speeds was after transferring 4 GB of data. Transferring 189 GB of data was done with 6.3 MB/s. Still better than before the changes...

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Samba Performance

Mon Aug 20, 2012 2:45 pm

beatmag wrote:is samba stable enough for 24/7 operation?
yes. I've been using both on my Pi since I got it (A couple months?) and I've been using it on Linux in general for years. It can be a bear to set up but patience and tweaking really pays off!
Dear forum: Play nice ;-)

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

Re: Samba Performance

Mon Aug 20, 2012 2:52 pm

abishur wrote:
beatmag wrote:is samba stable enough for 24/7 operation?
yes. I've been using both on my Pi since I got it (A couple months?) and I've been using it on Linux in general for years. It can be a bear to set up but patience and tweaking really pays off!
I've had som problems with stability. But turning off turbo_mode in the network driver helped. You can see more here: http://www.raspberrypi.org/phpBB3/viewt ... 47#p151547

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Samba Performance

Mon Aug 20, 2012 3:12 pm

tbar wrote:I've had som problems with stability. But turning off turbo_mode in the network driver helped. You can see more here: http://www.raspberrypi.org/phpBB3/viewt ... 47#p151547
Interesting. I've been transferring and stream large files with no hiccups (well no hiccups after the initial kernel panic fix that happened shortly after the pi came out ;-)). Samba is one of those very annoying things where it never seems to work identically on two separate boxes. Like I said patience and tweaking really pay off with Samba :lol:
Dear forum: Play nice ;-)

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

Re: Samba Performance

Tue Aug 21, 2012 6:40 am

Have anybody tried using Jumbo packets? I can't try myself as my router doesn't support packets > 1500 bytes.

It's relatively easy to setup:
1. Make sure every NIC, Switch, Router on the network supports Jumbo packets
2. For linux look at the following: http://www.debianhelp.co.uk/mtu.htm (don't make the change permanent to begin with!)
3. For windows look at : http://www.bitplumber.net/2009/03/how-t ... bo-frames/

For large files the benefit could be significant. Up to 20% higher throughput has been reported: http://www.codinghorror.com/blog/2009/0 ... rames.html

But beware: When I tried it it made my RPi unreachable through the network. I had to power-off the RPi to reach it again...

Dark
Posts: 21
Joined: Thu May 10, 2012 4:39 pm

Re: Samba Performance

Wed Aug 22, 2012 8:05 pm

BigEndian wrote:
Dark wrote:8-9megabyte/s with ext4 external hd (3.5"). Off course when transferring small files the speed drops.
do you get this speed on reading or on writing data to the raspberry?

I got around 4,5megabyte/s on reading and just 3megabyte/s on writing with an ext4 external hd.

I've then added the following line to smb.conf:

Code: Select all

socket options = TCP_NODELAY SO_RCVBUF=65535 SO_SNDBUF=65535
now I have around 7,5megabyte/s on reading but still just 4megabyte/s on writing.

I measured my pure USB HDD performance on raspian with the following commands:

writing:

Code: Select all

dd if=/dev/zero of=/media/usb0/test.tmp bs=500K count=1024
reading:

Code: Select all

dd if=/media/usb0/test.tmp of=/dev/null bs=500K count=1024
and I get around 9megs on writing and over 30megs on reading, so there must be another bottleneck. top told me about 40% CPU wait time. Is there any possibility to optimize the samba performance further?
Writing and reading are almost the same (7-8), somethimes the reading/writing can rise to 10 megabyte/s, but only for short times.

(im using the latest image, samba, no tweaks an a lacie external hard drive. Overclocked at 800Mhz, running headless =>lighttpd, php, mysql, transmission, samba, ssh, miniDLNA).
Attachments
smb.png
smb.png (24.75 KiB) Viewed 21678 times

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

Re: Samba Performance

Fri Aug 31, 2012 5:26 am

Overclocking seems to affect upload but not download.

When I had the this in config.txt:
arm_freq=800
sdram_freq=450
core_freq=400

My upload/download would look like this (Upload is red, Download is green, scale is MB/sec):
Capture_65536.PNG
Capture_65536.PNG (16.48 KiB) Viewed 21532 times
Changing config.txt to:
arm_freq=900
sdram_freq=450
core_freq=450

Made upload/download look like this:
Capture_65536_900mhz.PNG
Capture_65536_900mhz.PNG (16.66 KiB) Viewed 21532 times

So it would seem that upload benefits from overclocking but download doesn't.

beatmag
Posts: 25
Joined: Sun Apr 22, 2012 5:28 am

Re: Samba Performance

Sat Sep 01, 2012 3:05 pm

do you guys run your pi 24/7 as a samba server?

i've been wanting to order one for so long. but just read about the 1.8V LAN rail issue. And I'm not that keen, if its not stable or wont be stable for long.

any experiences with stability? 24/7 operation is that ok?
what kind of setups? are your LAN chips HOT? when did you guys get your pi?

User avatar
exartemarte
Posts: 373
Joined: Sat Mar 03, 2012 3:51 pm
Location: Middle England
Contact: Website

Re: Samba Performance

Sat Sep 01, 2012 3:41 pm

I have been using one to provide network-accessible storage via Samba since mid July. It runs 24/7 in a ModMyPi case; it runs warm but not hot and I've had no problems with it. (Until today, as it happens, but the problem I have today is with cracked plastic on the cardholder - nothing to do with Samba or 24/7 running.)

Dark
Posts: 21
Joined: Thu May 10, 2012 4:39 pm

Re: Samba Performance

Sat Sep 01, 2012 3:52 pm

beatmag wrote:do you guys run your pi 24/7 as a samba server?

i've been wanting to order one for so long. but just read about the 1.8V LAN rail issue. And I'm not that keen, if its not stable or wont be stable for long.

any experiences with stability? 24/7 operation is that ok?
what kind of setups? are your LAN chips HOT? when did you guys get your pi?
Running for a month non-stop. Works perfect !

CharliePL
Posts: 2
Joined: Sat Sep 01, 2012 10:52 pm
Location: PL

Re: Samba Performance

Sat Sep 01, 2012 11:04 pm

Tested on my RPi with 200 MB file:
Write: 10.57 MB/sec
Read: 11.33 MB/sec

I use GoodRAM SDHC 16GB Pro class 10:
Read: 19.4 MB/sec
Write: 18.0 MB/sec

My configuration:
Debian Wheezy Raspbian
arm_freq=910
sdram_freq=500
core_freq=480

Shane01638
Posts: 1
Joined: Tue Sep 04, 2012 9:57 pm
Location: Eagle River, AK

Re: Samba Performance

Tue Sep 04, 2012 10:14 pm

So I'm reading that ext4 is considerably faster than NTFS? I currently have a Linksys e3000 with dd-wrt sharing a 2TB USB hdd formatted with NTFS using Samba 3.6. I get about 2-3 MBps read/write over wireless N and a taxed cpu. I'd like to use my RPI (which is "in the mail!") to run the share and free up resources on my router. The e3000 works well, except when I'm copying a file to/from the share while trying to stream video at the same time. I'm not real keen to using ext4 as I am in a primarily Windows environment. Plus if I did go to ext4, I would have to buy another 2TB drive as I don't have enough room on any of my PC's to temporarily hold all that data while the drive is converted! I wouldn't mind staying around 2-3MBps if I'm able to have multiple video streams, or be able to stream while transferring files.

I would also like to use it as a dlna server (no encoding) and possibly a torrent server if possible. I currently stream to WDTV Live boxes and would like to stream to iPad as well if possible.
My Raspberry Pi is in the mail!

ksheka
Posts: 5
Joined: Wed Sep 12, 2012 7:17 pm

Re: Samba Performance

Thu Sep 13, 2012 8:12 pm

Anyone try checking transfer speeds when running rsync over ssh (ie: rsync -avz -e ssh [email protected]:/remote/dir /this/dir/ )?

I'm interested in replacing my current NAS box (Netgear ReadyNAS Duo) with a raspberry pi, since the ReadyNAS Duo has terrible throughput when transferring over ssh.

argief
Posts: 18
Joined: Sat Aug 18, 2012 6:35 pm

Re: Samba Performance

Fri Sep 14, 2012 11:07 pm

I guess it's no secret that SMB is not the most efficient protocol, and given that Win7 comes with native NFS support (Proffesional only) I think it could give us raspi users a bit more juice.

See this site for comparison (and screen shots for the non-believers :D ):
http://wdtvforum.com/main/index.php?topic=5393.0

SamuelDebruyn
Posts: 20
Joined: Sat Jan 21, 2012 5:04 pm
Contact: Website

Re: Samba Performance

Sat Sep 15, 2012 5:19 pm

Wow...

I only get about 0,5 MB/s write speeds on both NTFS, ExFAT and EXT4 over Samba.

Code: Select all

[global]
netbios name = samrpi
server string = Samba file and print server
workgroup = DD15
security = user
hosts allow = 127. 192.168.0.
interfaces = 127.0.0.1/8 192.168.0.0/24
bind interfaces only = yes
remote announce = 192.168.0.255
remote browse sync = 192.168.0.255
printcap name = cups
load printers = yes
cups options = raw
printing = cups
guest account = smbguest
log file = /var/log/samba/samba.log
max log size = 1000
null passwords = no
username level = 6
password level = 6
encrypt passwords = yes
unix password sync = yes
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65535 SO_SNDBUF=65535
local master = no
domain master = no
preferred master = no
domain logons = no
os level = 33
logon drive = m:
logon home = \\%L\homes\%u
logon path = \\%L\profiles\%u
logon script = %G.bat
time server = no
name resolve order = wins lmhosts bcast
wins support = no
wins proxy = no
dns proxy = no
preserve case = yes
short preserve case = yes
client use spnego = no
client signing = no
client schannel = no
server signing = no
server schannel = no
nt pipe support = yes
nt status support = yes
allow trusted domains = no
obey pam restrictions = yes
enable spoolss = yes

client plaintext auth = no
disable netbios = no
follow symlinks = no
update encrypted = yes
pam password change = no
passwd chat timeout = 120
hostname lookups = no
username map = /etc/samba/smbusers
passdb backend = tdbsam
passwd program = /usr/bin/passwd '%u'
passwd chat = *New*password* %n\n *ReType*new*password* %n\n *passwd*changed*\n
add user script = /usr/sbin/useradd -d /dev/null -c 'Samba User Account' -s /dev/null '%u'
add user to group script = /usr/sbin/useradd -d /dev/null -c 'Samba User Account' -s /dev/null -g '%g' '%u'
add group script = /usr/sbin/groupadd '%g'
delete user script = /usr/sbin/userdel '%u'
delete user from group script = /usr/sbin/userdel '%u' '%g'
delete group script = /usr/sbin/groupdel '%g'
add machine script = /usr/sbin/useradd -d /dev/null -g sambamachines -c 'Samba Machine Account' -s /dev/null -M '%u'
machine password timeout = 120
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
template shell = /dev/null
winbind use default domain = yes
winbind separator = @
winbind cache time = 360
winbind trusted domains only = yes
winbind nested groups = no
winbind nss info = no
winbind refresh tickets = no
winbind offline logon = no

[netlogon]
comment = Network Logon Service
path = /home/netlogon
read only = no
available = yes
browseable = yes
writable = no
guest ok = no
public = no
printable = no
locking = no
strict locking = no

[profiles]
comment = User Profiles
path = /var/samba/profiles
read only = no
available = yes
browseable = no
writable = yes
guest ok = no
public = no
printable = no
create mode = 0600
directory mask = 0700
locking = no
strict locking = no

[printers]
comment = All Printers
path = /var/spool/samba
browseable = yes
writable = no
guest ok = no
public = no
printable = yes
locking = no
strict locking = no

[pdf-documents]
path = /home/pdf-documents
comment = Converted PDF Documents
available = yes
browseable = yes
writeable = yes
guest ok = yes
locking = no
strict locking = no

[pdf-printer]
path = /tmp
comment = PDF Printer Service
printable = yes
guest ok = yes
use client driver = yes
printing = bsd
print command = /usr/bin/gadmin-samba-pdf %s %u
lpq command =
lprm command =

[ehdd]
path = /media/ehdd
comment = External HDD
read only = no
available = yes
browseable = yes
writable = yes
guest ok = no
public = no
printable = no
locking = no
strict locking = no
dd test is 19 MB/s read and 3 MB/s write

User avatar
debazthed
Posts: 5
Joined: Thu Jan 19, 2012 1:34 pm

Re: Samba Performance

Thu Sep 20, 2012 8:07 am

ksheka wrote:Anyone try checking transfer speeds when running rsync over ssh (ie: rsync -avz -e ssh [email protected]:/remote/dir /this/dir/ )?

I'm interested in replacing my current NAS box (Netgear ReadyNAS Duo) with a raspberry pi, since the ReadyNAS Duo has terrible throughput when transferring over ssh.
Yes I did try that (only for writing) and sadly it gave me almost the same writing speed as with SMB ~2MB/s

scales11
Posts: 20
Joined: Tue Oct 09, 2012 2:54 pm

Re: Samba Performance

Tue Oct 09, 2012 5:24 pm

Any updates on this? I would really like to use my Pi as a NAS. In fact, I am very interested in running something like openmediavault on it. I have seen a few more posts that discuss openmediavault, but not many success stories.

Return to “Networking and servers”