On big files I can get around 3 MB/sec using scp, so it's 50 percent faster than my ReadyNAS, but "performance" and "Raspberry Pi" really shouldn't be used in the same sentence.
My Linux boxes with AMD x4 3GHz CPUs and 4 or more gig of RAM with WD Green hard drives get 35MB/s, and my Promise Pegasus array on my Mac Mini is about twice that, so I love my RPi (and hate my ReadyNASes), but it's not a useful SMB server...
Re: Samba Performance
Well I would never compare it to a full out desktop...thats just not a fair comparison.
I am more interested in the functionality/reliability/usability of it as a NAS.
I am more interested in the functionality/reliability/usability of it as a NAS.
Re: Samba Performance
I've generally found that the reliability of a NAS share is as reliable as it's drives, so RAID is the way to go unless you have other local backups. Looks like mdadm loads on Raspian, FWIW, but then there's that performance thing again...
OK, so grab a couple of 1TB USB drives and connect them to a hub and thence to the RPi
apt-get install mdadm
mdadm --create --level=mirror --raid-devices=2 /dev/md0 /dev/sda /dev/sdb
mkfs -t ext4 -v /dev/md0
mkdir /mnt/raid
mount /dev/md0 /mnt/raid
df -h
[...]
/dev/md0 917G 200M 870G 1% /mnt/raid
apt-get install samba
[Really ugly and insecure smb.conf, don't use this unless you are on a LAN, with no port forwarding to this machine, and you trust everyone on your LAN. Do as I say, not as I do. 8*]
----------------
[global]
workgroup = RaspberryPi
server string = RPi
local master = no
domain master = no
preferred master = no
password server = None
guest ok = yes
guest account = root
security = SHARE
dns proxy = no
[RPi-system]
path = /
guest ok = yes
writeable = yes
create mask = 0777
---------------------------
service samba restart
Now you can copy files in and out. [Wait for /proc/mdstat to show completion before testing for speed, a couple of days(!) at my current rate.]
Hmm, actually, I wrote a 1.75G file in 4:00 minutes, so 7.5MB/sec, not awful.
Read it back in 3:45, so almost 8MB/sec, lots faster than my (2MB/sec, no wait, it's dropped to 1.44) ReadyNAS....
More benchmarks after the sync completes, but it's usable....
[This is a pretty basic Raspian with Turbo enabled, the chip gets pretty warm....]
OK, so grab a couple of 1TB USB drives and connect them to a hub and thence to the RPi
apt-get install mdadm
mdadm --create --level=mirror --raid-devices=2 /dev/md0 /dev/sda /dev/sdb
mkfs -t ext4 -v /dev/md0
mkdir /mnt/raid
mount /dev/md0 /mnt/raid
df -h
[...]
/dev/md0 917G 200M 870G 1% /mnt/raid
apt-get install samba
[Really ugly and insecure smb.conf, don't use this unless you are on a LAN, with no port forwarding to this machine, and you trust everyone on your LAN. Do as I say, not as I do. 8*]
----------------
[global]
workgroup = RaspberryPi
server string = RPi
local master = no
domain master = no
preferred master = no
password server = None
guest ok = yes
guest account = root
security = SHARE
dns proxy = no
[RPi-system]
path = /
guest ok = yes
writeable = yes
create mask = 0777
---------------------------
service samba restart
Now you can copy files in and out. [Wait for /proc/mdstat to show completion before testing for speed, a couple of days(!) at my current rate.]
Hmm, actually, I wrote a 1.75G file in 4:00 minutes, so 7.5MB/sec, not awful.
Read it back in 3:45, so almost 8MB/sec, lots faster than my (2MB/sec, no wait, it's dropped to 1.44) ReadyNAS....
More benchmarks after the sync completes, but it's usable....
[This is a pretty basic Raspian with Turbo enabled, the chip gets pretty warm....]
Re: Samba Performance
OK, did some more benchmarking once the sync was done, and it made no real difference:
7.8MB/sec read
7.25MB/sec write
Just realized that's not awful for a $300(or less), 1TB RAID array.
7.8MB/sec read
7.25MB/sec write
Just realized that's not awful for a $300(or less), 1TB RAID array.
Re: Samba Performance
@wpns: have you read some of the earlier posts in this thread? There are described some ways to get a bit more performance. OC is one way but there are some configs you can use in the samba config file which can improve performance.
Re: Samba Performance
Well, there are always optimizations, but they will never close the gap between a $300 NAS drive that'll do 8-ish MB/sec and my usual $650-ish NAS boxes that'll do 45MB/sec. (In fact, on a 100 megabit network, you'll never do better than 12 MB/sec.)
But the implied metric of $/MB/Sec is a silly one, it depends on what you need it for, and how much you have to spend. If you don't care about RAID, and you don't need a terabyte, and you have some bits lying around, you can build a NAS box for under $100. Just the barebones chassis for the Shuttle boxes I build my NAS boxes on is $200.
The amazing part of this is how quickly and easily you can build a NAS box using a RPi with usable performance! [OK, so I take back my statement that you can't use RPi and performance in the same sentence.]
But the implied metric of $/MB/Sec is a silly one, it depends on what you need it for, and how much you have to spend. If you don't care about RAID, and you don't need a terabyte, and you have some bits lying around, you can build a NAS box for under $100. Just the barebones chassis for the Shuttle boxes I build my NAS boxes on is $200.
The amazing part of this is how quickly and easily you can build a NAS box using a RPi with usable performance! [OK, so I take back my statement that you can't use RPi and performance in the same sentence.]
Re: Samba Performance
So now that the drivers for the PI are open source, does this mean we could get better usb performance?
I tried using a "distro" called squeezeplug on the pi. It is pretty impressive and easy to use. Unfortunately, I was not getting speeds better than 3-5Mpbs..
here is the distro:
http://www.squeezeplug.eu/
I tried using a "distro" called squeezeplug on the pi. It is pretty impressive and easy to use. Unfortunately, I was not getting speeds better than 3-5Mpbs..
here is the distro:
http://www.squeezeplug.eu/
Re: Samba Performance
Actually, the USB drivers have always been open source. The only thing that have opened up are the GPU "drivers" that reside in the CPU userland (and since that was the only thing that was closed means the CPU stuff is 100% open source nowscales11 wrote:So now that the drivers for the PI are open source, does this mean we could get better usb performance?
I tried using a "distro" called squeezeplug on the pi. It is pretty impressive and easy to use. Unfortunately, I was not getting speeds better than 3-5Mpbs..
here is the distro:
http://www.squeezeplug.eu/

Dear forum: Play nice 

Re: Samba Performance
I just put Arch on my raspberry pi. I figured that if I started with the minimal install and then added samba myself, I would get better performance since there was less overhead. So after setting samba up via ssh, it would appear that I was wrong. My speeds are less than 3Mbps when transferring several 10x400mb files from my windows 7 64bit machine. I have my external NTFS hdd connected via usb. It seems that others got slightly better performance with ext3 or ext4, but I was not sure if it was really that big of a difference.
Any one have any suggestions on how I could get better performance? Is there a minimal debian setup I could try?
Any one have any suggestions on how I could get better performance? Is there a minimal debian setup I could try?
-
- Posts: 18
- Joined: Wed Jul 04, 2012 1:37 pm
Re: Samba Performance
You must convert file system to ext 3 or 4. NTFS is a very big bottleneck.
Re: Samba Performance
OK, will do. I am just re-reading this thread, seems like everyone else was doing that...sorry.scorpion_tr wrote:You must convert file system to ext 3 or 4. NTFS is a very big bottleneck.
EDIT:
WOW big change indeed. With ext4 I am at almost 7Mbps. I would like to eek out a little more, but this certainly is a good start.
Re: Samba Performance
I was getting 2.5 to 3MBs on my ntfs setup using squeezeplug. jusf set squeezeplug 5 up on my other pi with an external drive as ext4 and now i get 7.8 to 10. Chuffed would be an under statement.
- learning the hard way. Who needs to walk when running is more fun
Re: Samba Performance
Just tried installing NFS on RPi and NFS Client for Windows. I'm getting write speeds at approx 5.4 MB/s and read speeds at approx 7.5 MB/s. Tried the same with a virtual Linux-server on the same Windows computer which gives write/read speeds at approx 6 MB/s / 6.7 MB/s.
SMB on the same computers gives write/read speeds at approx 9.5 MB/s / 9 MB/s.
SMB on the same computers gives write/read speeds at approx 9.5 MB/s / 9 MB/s.
Re: Samba Performance
Got my pi over a week ago. Took a while to set it all up but now its working brilliantly as a standalone NAS and bit-torrent client.
With NTFS I was getting read speeds around 5MB/s and abysmal write speeds around 2MB/s. I then formatted all three of my 1TB externals to ext4 and all of a sudden I am getting write speeds of 10.4MB/s and read speed around 6-7 MB/s. A bit surprised that the read speed is slower than write but I think a few other users here experienced the same. Anybody knows the reason? I am running on stock speed, no overclocking.
Just a heads up for those of you who are experiencing speeds less than 1MB/s. It could be because of your USB hub. Initially I was getting around 200-300KB/s read & write when the drives were connected to my Belkin 7 port powered hub. The problem was two fold. One, the mini USB cable from the hub to the pi was too long and kept dropping data packets. Second, I learned that only the last 4 ports on my hub can deliver full speed. Took a lot of trial and error to get to the bottom of all the speed issues. So I hope this information helps someone.
With NTFS I was getting read speeds around 5MB/s and abysmal write speeds around 2MB/s. I then formatted all three of my 1TB externals to ext4 and all of a sudden I am getting write speeds of 10.4MB/s and read speed around 6-7 MB/s. A bit surprised that the read speed is slower than write but I think a few other users here experienced the same. Anybody knows the reason? I am running on stock speed, no overclocking.
Just a heads up for those of you who are experiencing speeds less than 1MB/s. It could be because of your USB hub. Initially I was getting around 200-300KB/s read & write when the drives were connected to my Belkin 7 port powered hub. The problem was two fold. One, the mini USB cable from the hub to the pi was too long and kept dropping data packets. Second, I learned that only the last 4 ports on my hub can deliver full speed. Took a lot of trial and error to get to the bottom of all the speed issues. So I hope this information helps someone.
Re: Samba Performance
How you can get so fast speed? I have 1.2 mb/s in ntfs and 3.5mb/s in ext4...

Re: Samba Performance
Are you using external USB HDD or internal SD Card?emajko159 wrote:How you can get so fast speed? I have 1.2 mb/s in ntfs and 3.5mb/s in ext4...
Re: Samba Performance
Internal sata hdd over sata to usb converter.
Re: Samba Performance
What kind/brand of sata to usb converter? Have you tried using it in another setup (Windows)?emajko159 wrote:Internal sata hdd over sata to usb converter.
Re: Samba Performance
The converter is not causality. In my desktop pc have speed about 34MB/ what is aproximately maximum of usb 2.0.
Re: Samba Performance
Your drive has an external power adapter right? And you are not using a USB hub right? If that's the case then its baffling to hear you only getting 3.5MB/s with ext4.emajko159 wrote:How you can get so fast speed? I have 1.2 mb/s in ntfs and 3.5mb/s in ext4...

I am getting 10.5 MB/s for all three 1TB drives connected to the Pi with CPU usage only around 50-60%. I wish the Pi had gigabit ethernet because I'm sure it can write 15-18 MB/s with 100% cpu.
Re: Samba Performance
My usb cable is short - 30 centimeters. I am using powered USB hub. I use ethernal cable. wifi not. In my home network I can have speed about 10,8MB/s. As operating system I am using squeezeplug in newest version.
Re: Samba Performance
Hello everyone!
First off, I found this thread because I ran into some performance issues with samba myself (turned out to be the wireless). I now have speeds of about 10MB/s and because I read a lot of people are having performance issues, I decided to share as much details about my configuration as I can, in hope that this will be of help for people with bad performance.
First off, I am using the 2012-12-16 raspbian wheezy hard float image (http://www.raspberrypi.org/downloads). It's overclocked using the raspi-config tool (turbo option, so 1000MHz ARM, 500MHz core, 600MHz SDRAM, 6 overvolt).
Info about the hard drive using hdparm -I:
/etc/samba/smb.conf:
The file system used is ext4. For every samba user, I make a seperate image file (using the truncate command followed by mkfs.ext4 and then editing the /etc/fstab file to make it mount in /home/username).
I am using a phone charger that can provide 1500mA of current, with the original cable.
The PC was connected to a router (fonera 2.0n) several meters long. The raspberry pi was also connected to the same router, using a cable that is about 20cm long (guestimate). The USB cable connecting the HDD is about 1.5 to 1.8 meters.
==================================
Here are some things I 'learned' and wanted to share, which might help:
- Wireless is very slow, even if you are using 802.11n. When I used wireless, I had speeds of 100kb/s if I was lucky. Using a LAN cable on the same device got me speeds of about 10MB/s.
- It is a good idea to use testparm to create your smb.conf file, as it checks syntax and also makes the file considerably shorter. This can be done using the following commands:
If you want to edit your configuration, simply edit smb.conf.master, instead of smb.conf and the rerun the command
- Cable length does not seem to affect performance by much.
I will post back later to see how much overclocking and using wireless instead of LAN affects perfomance.
First off, I found this thread because I ran into some performance issues with samba myself (turned out to be the wireless). I now have speeds of about 10MB/s and because I read a lot of people are having performance issues, I decided to share as much details about my configuration as I can, in hope that this will be of help for people with bad performance.
First off, I am using the 2012-12-16 raspbian wheezy hard float image (http://www.raspberrypi.org/downloads). It's overclocked using the raspi-config tool (turbo option, so 1000MHz ARM, 500MHz core, 600MHz SDRAM, 6 overvolt).
Info about the hard drive using hdparm -I:
Code: Select all
sudo hdparm -I /dev/sda
/dev/sda:
ATA device, with non-removable media
Model Number: Hitachi HDS721010CLA332
Serial Number: JP2940HD26YMKC
Firmware Revision: JP4OA3EA
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6; Revision: ATA8-AST T13 Project D1697 Revision 0b
Standards:
Used: unknown (minor revision code 0x0029)
Supported: 8 7 6 5
Likely used: 8
Configuration:
Logical max current
cylinders 16383 16383
heads 16 16
sectors/track 63 63
--
CHS current addressable sectors: 16514064
LBA user addressable sectors: 268435455
LBA48 user addressable sectors: 1953525168
Logical/Physical Sector size: 512 bytes
device size with M = 1024*1024: 953869 MBytes
device size with M = 1000*1000: 1000204 MBytes (1000 GB)
cache/buffer size = 29999 KBytes (type=DualPortCache)
Form Factor: 3.5 inch
Nominal Media Rotation Rate: 7200
Capabilities:
LBA, IORDY(can be disabled)
Queue depth: 32
Standby timer values: spec'd by Standard, no device specific minimum
R/W multiple sector transfer: Max = 16 Current = 0
Advanced power management level: disabled
DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=120ns IORDY flow control=120ns
Commands/features:
Enabled Supported:
* SMART feature set
Security Mode feature set
* Power Management feature set
* Write cache
* Look-ahead
* Host Protected Area feature set
* WRITE_BUFFER command
* READ_BUFFER command
* DOWNLOAD_MICROCODE
Advanced Power Management feature set
Power-Up In Standby feature set
* SET_FEATURES required to spinup after power up
SET_MAX security extension
* 48-bit Address feature set
* Device Configuration Overlay feature set
* Mandatory FLUSH_CACHE
* FLUSH_CACHE_EXT
* SMART error logging
* SMART self-test
Media Card Pass-Through
* General Purpose Logging feature set
* WRITE_{DMA|MULTIPLE}_FUA_EXT
* 64-bit World wide name
* URG for READ_STREAM[_DMA]_EXT
* URG for WRITE_STREAM[_DMA]_EXT
* WRITE_UNCORRECTABLE_EXT command
* Segmented DOWNLOAD_MICROCODE
* Gen1 signaling speed (1.5Gb/s)
* Gen2 signaling speed (3.0Gb/s)
* Native Command Queueing (NCQ)
* Host-initiated interface power management
* Phy event counters
* NCQ priority information
Non-Zero buffer offsets in DMA Setup FIS
DMA Setup Auto-Activate optimization
Device-initiated interface power management
In-order data delivery
* Software settings preservation
* SMART Command Transport (SCT) feature set
* SCT LBA Segment Access (AC2)
* SCT Error Recovery Control (AC3)
* SCT Features Control (AC4)
* SCT Data Tables (AC5)
Security:
Master password revision code = 65534
supported
not enabled
not locked
not frozen
not expired: security count
not supported: enhanced erase
224min for SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000cca373df5877
NAA : 5
IEEE OUI : 000cca
Unique ID : 373df5877
Checksum: correct
Code: Select all
[global]
server string = %h server
map to guest = Bad User
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
dns proxy = No
usershare allow guests = Yes
panic action = /usr/share/samba/panic-action %d
idmap config * : backend = tdb
[allusers]
comment = All Users
path = /home/allusers
valid users = @users
read only = No
create mask = 0660
directory mask = 0771
[homes]
comment = Home Directories
valid users = @users
read only = No
create mask = 0700
directory mask = 0700
browseable = No
I am using a phone charger that can provide 1500mA of current, with the original cable.
The PC was connected to a router (fonera 2.0n) several meters long. The raspberry pi was also connected to the same router, using a cable that is about 20cm long (guestimate). The USB cable connecting the HDD is about 1.5 to 1.8 meters.
==================================
Here are some things I 'learned' and wanted to share, which might help:
- Wireless is very slow, even if you are using 802.11n. When I used wireless, I had speeds of 100kb/s if I was lucky. Using a LAN cable on the same device got me speeds of about 10MB/s.
- It is a good idea to use testparm to create your smb.conf file, as it checks syntax and also makes the file considerably shorter. This can be done using the following commands:
Code: Select all
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.master
testparm -s /etc/samba/smb.conf.master | sudo tee /etc/samba/smb.conf
Code: Select all
testparm -s /etc/samba/smb.conf.master | sudo tee /etc/samba/smb.conf
I will post back later to see how much overclocking and using wireless instead of LAN affects perfomance.
- Attachments
-
- sambaspeed.jpg (44.37 KiB) Viewed 27052 times
Re: Samba Performance
Alright, just finished testing.
I tried to measure wireless speed the best I could, but it fluctuated quite a bit. At some points, I had speeds of around 50 - 100 kb/s. So to test the speed, I copied two files when the speed seemed stable. Note that both test were with the raspberry pi overclocked in turbo mode.
=============
Transfer 1 - wireless (overclocked in turbo mode)
File size: 337MiB
Time required for transfer: 197s
Average speed: 1,7MiB/s
=============
Transfer 2 - wireless (overclocked in turbo mode)
File size: 777MiB
Time required for transfer: 290s
Average speed: 2,7MiB/s
For the wired transfer, I copied a 10GiB file.
=============
Transfer 3 - wired (overclocked in turbo mode)
File size: 10340MiB
Time required for transfer: 1040s
Average speed: 9,9MiB/s
=============
Transfer 4 - wired (no overclock)
File size: 10340MiB
Time required for transfer: 1212s
Average speed: 8,5MiB/s
I tried to measure wireless speed the best I could, but it fluctuated quite a bit. At some points, I had speeds of around 50 - 100 kb/s. So to test the speed, I copied two files when the speed seemed stable. Note that both test were with the raspberry pi overclocked in turbo mode.
=============
Transfer 1 - wireless (overclocked in turbo mode)
File size: 337MiB
Time required for transfer: 197s
Average speed: 1,7MiB/s
=============
Transfer 2 - wireless (overclocked in turbo mode)
File size: 777MiB
Time required for transfer: 290s
Average speed: 2,7MiB/s
For the wired transfer, I copied a 10GiB file.
=============
Transfer 3 - wired (overclocked in turbo mode)
File size: 10340MiB
Time required for transfer: 1040s
Average speed: 9,9MiB/s
=============
Transfer 4 - wired (no overclock)
File size: 10340MiB
Time required for transfer: 1212s
Average speed: 8,5MiB/s
-
- Posts: 3
- Joined: Wed Jul 11, 2012 8:31 pm
Re: Samba Performance
Would be interested in knowing if a gigabit ethernet dongle hooked up to one of the USB ports would give better performance.
Re: Samba Performance
A USB to Gigabit Ethernet dongle should be able to provide around 14MB/s unless some other bottleneck crops up which I'm not currently aware of. I have tested the real world transfer speed of the USB on the Pi to be around 28.7MB/s. Since USB is half duplex, the Samba transfer speed will be halved because it involves both read and write processes using the same bus, hence the 14MB/s figure.
Now I have to decide whether a whole 4MB/s gain is worth plonking down $20 for a USB Gigabit Ethernet dongle
Then I have my doubts whether the driver will work or not but I guess the kernel can always be recompiled as long as the drivers are actually available for linux.
Now I have to decide whether a whole 4MB/s gain is worth plonking down $20 for a USB Gigabit Ethernet dongle
