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

Re: USB HD and Samba performance

Sun Apr 22, 2012 7:20 am

Sorry if this has been asked before. But I have searched many times through these forums and pretty much couldn't find an answer.

I wanted to ask for those who are lucky enough to get a raspberry pi, if they can post the USB HD performance and also the SAMBA performance through the ethernet as well.

USB HD over SAMBA transfer speed:

Read and Write?

I understand that raspberry pi is for development use, but how feasible would it be to use it to run a SAMBA server 24/7?

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

Re: USB HD and Samba performance

Sun Apr 22, 2012 2:50 pm

I'm using a usb hard drive and accessing it via samba.  One caveat, I'm doing this with the Pi physically wired into the network but with my test machine using wireless (which I think is fair enough since that's how a lot of us will be doing this), nothing else is even turned on so nothing else is using the network.

I'm using Lan Speed Test to test this, it performs 1 write than 1 read as many times as you ask it to up to 100.

1MB = 1,000,000 bytes

First test:  100 read/writes of 1MB (I'm trying to simulate a lot of read/writing to see how the USB bus holds up

Time to complete writes: 50.30 seconds

Time to complete reads: 40.84 seconds

Second test: 100 read/writes of 10MB

Test failed as it caused a kernel panic
Dear forum: Play nice ;-)

rmm200
Posts: 259
Joined: Sat Mar 03, 2012 10:25 pm

Re: USB HD and Samba performance

Sun Apr 22, 2012 4:30 pm

Kernel panic is pretty severe. Think memory got stepped on? Guessing the SoC has a DMA controller. Bad pointer?

User avatar
rew
Posts: 410
Joined: Fri Aug 26, 2011 3:25 pm

Re: USB HD and Samba performance

Sun Apr 22, 2012 4:31 pm

You're getting about 100Mb in 50 seconds, so about 2Mb/sec ?

This is with the internal SD card? I have the impression that the internal SD card interface is quite slow. I've seen it reach speeds of up to 4Mb per second, peak! The SD cards that I use reach speeds of 15Mbyte per second in the $3 Chinese SD card readers....

It could be that the SD card driver in the linux kernel still needs some optimizing.
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

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

Re: USB HD and Samba performance

Sun Apr 22, 2012 11:32 pm

rew said:


You're getting about 100Mb in 50 seconds, so about 2Mb/sec ?

This is with the internal SD card?


Nope. I specifically said I was using a USB HD
Dear forum: Play nice ;-)

zfh10
Posts: 41
Joined: Sun Mar 18, 2012 10:13 am

Re: USB HD and Samba performance

Sun Apr 22, 2012 11:39 pm

can someone please translate this performance for the non-nerds among us

nicknml
Posts: 198
Joined: Thu Mar 15, 2012 8:44 pm

Re: USB HD and Samba performance

Mon Apr 23, 2012 1:32 am

zfh10 said:


can someone please translate this performance for the non-nerds among us



The performance is fairly slow and unstable right now.

lewmur
Posts: 350
Joined: Sun Dec 25, 2011 3:20 pm
Contact: Website

Re: USB HD and Samba performance

Mon Apr 23, 2012 1:46 am

nicknml said:


zfh10 said:


can someone please translate this performance for the non-nerds among us


The performance is fairly slow and unstable right now.



Compared to what?  Compared to an IPad?  Compared to a netbook with an Atom 1.6ghz processor?  Or compared to cheap tablet with an ARM processor running a 8ghz running Android?  IMHO, the last one is the only relevant comparison.

User avatar
rew
Posts: 410
Joined: Fri Aug 26, 2011 3:25 pm

Re: USB HD and Samba performance

Mon Apr 23, 2012 6:27 am

It seems USB "mass storage" access is buggy. At the moment it is so buggy that performance measurements crash before you get a reading.

I tried my SD card reader and that crashed. I have other things to do, so that's when I left it.
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

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

Re: USB HD and Samba performance

Mon Apr 23, 2012 12:16 pm

rew said:


It seems USB "mass storage" access is buggy. At the moment it is so buggy that performance measurements crash before you get a reading.

I tried my SD card reader and that crashed. I have other things to do, so that's when I left it.



When you say SD card reader do you mean usb sd card reader, or the built in one on the R-pi?
Dear forum: Play nice ;-)

nicknml
Posts: 198
Joined: Thu Mar 15, 2012 8:44 pm

Re: USB HD and Samba performance

Mon Apr 23, 2012 12:17 pm

lewmur said:


nicknml said:


zfh10 said:


can someone please translate this performance for the non-nerds among us


The performance is fairly slow and unstable right now.


Compared to what?  Compared to an IPad?  Compared to a netbook with an Atom 1.6ghz processor?  Or compared to cheap tablet with an ARM processor running a 8ghz running Android?  IMHO, the last one is the only relevant comparison.


I want an 8GHz ARM processor!

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

Re: USB HD and Samba performance

Thu Apr 26, 2012 11:32 am

has all the issues been resolved?

its been quiet in this thread?

lewmur
Posts: 350
Joined: Sun Dec 25, 2011 3:20 pm
Contact: Website

Re: USB HD and Samba performance

Thu Apr 26, 2012 12:07 pm

nicknml said:


lewmur said:


nicknml said:


zfh10 said:


can someone please translate this performance for the non-nerds among us


The performance is fairly slow and unstable right now.


Compared to what?  Compared to an IPad?  Compared to a netbook with an Atom 1.6ghz processor?  Or compared to cheap tablet with an ARM processor running a 8ghz running Android?  IMHO, the last one is the only relevant comparison.


I want an 8GHz ARM processor!



Me too!  Meant an .8ghz.  Ah those misplaced decimal points.

User avatar
Kushan
Posts: 26
Joined: Tue Apr 17, 2012 7:49 pm

Re: USB HD and Samba performance

Thu Apr 26, 2012 12:14 pm

Isn't the ethernet controller actually attached via the USB bus, so we're actually limited by the speed of USB in general?

If that's the case, that might explain why performance seems so poor when using a USB HD to transfer stuff via ethernet.

User avatar
ArborealSeer
Posts: 300
Joined: Tue Jan 24, 2012 9:48 am
Location: South West, UK

Re: USB HD and Samba performance

Thu Apr 26, 2012 1:07 pm

as i understand it from previous posts, that is correct.
Pi Status > Farnell, Arrived 24/5- RS, Arrived 1/6

lewmur
Posts: 350
Joined: Sun Dec 25, 2011 3:20 pm
Contact: Website

Re: USB HD and Samba performance

Thu Apr 26, 2012 2:46 pm

Kushan said:


Isn't the ethernet controller actually attached via the USB bus, so we're actually limited by the speed of USB in general?

If that's the case, that might explain why performance seems so poor when using a USB HD to transfer stuff via ethernet.



A single USB 2.0 controller can handle 60mb/sec.  The ethernet port is about 10mb/sec.  So that leaves 50mb/sec for the USB HDD.  You know of any USB HDD's that'll write that fast?  Not much of a bottleneck.

User avatar
eshatohhin
Posts: 11
Joined: Tue May 15, 2012 12:27 pm
Location: Estonia

Re: USB HD and Samba performance

Fri May 18, 2012 8:24 am

tested samba performance over ethernet using old 80gb IDE drive connected to pi using £2 USB 2.0 to IDE Adapter Cable from ebay:

write: ~9mb/sec

Cpu(s): 10.8%us, 57.3%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 31.8%si, 0.0%st
Mem: 190836k total, 178756k used, 12080k free, 2412k buffers
Swap: 0k total, 0k used, 0k free, 156996k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
958 nobody 20 0 16980 3076 2320 R 78.7 1.6 0:53.96 smbd
31 root 20 0 0 0 0 D 9.0 0.0 0:09.75 usb-storage

read: ~7.5mb sec
Cpu(s): 5.5%us, 54.8%sy, 0.0%ni, 0.0%id, 2.3%wa, 0.0%hi, 37.4%si, 0.0%st
Mem: 190836k total, 178568k used, 12268k free, 2184k buffers
Swap: 0k total, 0k used, 0k free, 159348k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
958 nobody 20 0 16980 3336 2584 R 72.1 1.7 0:20.71 smbd
31 root 20 0 0 0 0 S 18.8 0.0 0:05.26 usb-storage

For some reason writing is faster (usb-storage requires less cpu, so smbd can get the most of it)
After few minutes system crashed, i guess its related to the buggy usb driver as mentioned in previous post.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5151
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: USB HD and Samba performance

Fri May 18, 2012 8:48 am

@eshatohhin
Have you updated your kernel (e.g.with hexxeh's firmware updater tool)?

User avatar
eshatohhin
Posts: 11
Joined: Tue May 15, 2012 12:27 pm
Location: Estonia

Re: USB HD and Samba performance

Fri May 18, 2012 2:31 pm

Thanks @dom.
Updated firmware as you suggested and all the packages.

Now the stability seems to have improved. Transferred 5 gigs back and forth with no problems now.
At first I suspected that the problem was caused by the lack of power, as my rasp is currently draining power from monitors usb port.

Pianist
Posts: 2
Joined: Wed Jul 18, 2012 4:06 pm

Re: USB HD and Samba performance

Wed Jul 18, 2012 4:18 pm

eshatohhin wrote:tested samba performance over ethernet using old 80gb IDE drive connected to pi using £2 USB 2.0 to IDE Adapter Cable from ebay:

write: ~9mb/sec
read: ~7.5mb sec
When I transfer data from/to a Win-PC to the RaPi-smbd I only achieve up to ~800kByte/s, but not stable: sometimes it drops down to ~300 kByte/s. The cpu load is always below 30%.

eshatohhin, can you tell me which distri do you use? Did you do a firmware update? Other hints?

Thanks.

Pianist
Posts: 2
Joined: Wed Jul 18, 2012 4:06 pm

Re: USB HD and Samba performance

Fri Jul 20, 2012 11:18 am

Short update:
I'm using Debian wheezy. Yesterday I installed the hexxeh's firmware update. After that everything stayed the same: most time just 300 kByte/s.
So I did an package-update with aptitude (took ~1.5 hours). After that my throughput raised up to 1MByte/s. Samba-d is much more stable now. Even no big lags anymore when using a 2nd Win-Explorer to browse directories.

If someone has an idea how to increase speed once more, I'd be glad. ;-)

evil
Posts: 23
Joined: Mon Jul 23, 2012 11:22 am
Location: Austria

Re: USB HD and Samba performance

Mon Jul 23, 2012 11:29 am

I tried the debian squeeze image yesterday and I got 7,5 MB/s read and 5,8 MB/s write performance (samba and windows 7).
Writing was first very instable - then I change the max_sector value from 240 to 480 .

cat /sys/block/sda/device/max_sectors
>240

echo 480 > /sys/block/sda/device/max_sectors

After that it worked stable for the next few test copys.


This ist a huge disappointment! USB and Ethernet on the same USB-Port I expected poor performance, but this result is really bad.

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: USB HD and Samba performance

Mon Jul 23, 2012 11:36 am

I've done half a dozen of tweaks to mine, which I jotted down somewhere and promptly lost.

For large files, you can leverage:
3.5 Readahead

The option readahead IS NOT the same as multcount. The multcount refers to the possibility of the hardware to read more than one sector at a time while the readahead option is the number of sectors ahead your computer should read. The readahead feature is great when reading big-size files but it brings down the performance for short-size files. A good idea is to leave the value of readahead the same as the multcount so it will not be needed to make more than an access per time to read more sectors ahead.

If you are going to access big files you can set the readahead to a greater value. The default value is 8 sectors/read access (something like 4kb).

Now the syntax:

# hdparm -a N /dev/hda

N is the number of sectors for readahead.
There's a setting somewhere to cache more in RAM too, or rather, to queue stuff in RAM then write it in one fell swoop instead of thrashing like crazy on the HD... I'll come back when I find it

evil
Posts: 23
Joined: Mon Jul 23, 2012 11:22 am
Location: Austria

Re: USB HD and Samba performance

Mon Jul 23, 2012 11:38 am

I tried the debian squeeze image yesterday and I got 7,5 MB/s read and 5,8 MB/s write performance (samba and windows 7).
Writing was first very instable - then I change the max_sector value from 240 to 480 .

cat /sys/block/sda/device/max_sectors
>240

echo 480 > /sys/block/sda/device/max_sectors

After that it worked stable for the next few test copys.


This ist a huge disappointment! USB and Ethernet on the same USB-Port I expected poor performance, but this result is really bad.

evil
Posts: 23
Joined: Mon Jul 23, 2012 11:22 am
Location: Austria

Re: USB HD and Samba performance

Mon Jul 23, 2012 11:39 am

I tried the debian squeeze image yesterday and I got 7,5 MB/s read and 5,8 MB/s write performance (samba and windows 7).
Writing was first very instable - then I change the max_sector value from 240 to 480 .

cat /sys/block/sda/device/max_sectors
>240

echo 480 > /sys/block/sda/device/max_sectors

After that it worked stable for the next few test copys.


This ist a huge disappointment! USB and Ethernet on the same USB-Port I expected poor performance, but this result is really bad.

Return to “General discussion”

Who is online

Users browsing this forum: mahjongg and 72 guests