Very Slow Samba Shares

Ask questions about Arch Linux ARM. Please search before making a new topic.

Re: Very Slow Samba Shares

Postby netter » Thu Jan 06, 2011 3:21 pm

try different partition formats, ntfs, etx2, and compare results. start from there and then after that start tweaking samba. the culprit can also be your router too
netter
 
Posts: 24
Joined: Thu Sep 30, 2010 1:22 am

Re: Very Slow Samba Shares

Postby GnuFlip » Fri Jan 07, 2011 12:40 am

So I finally looked up how to benchmark a drive and the results are pretty disappointing. These are on the dockstar itself, I ssh'd into it and ran these commands. Here are the results:

ext2 partition (same drive as the ext3 root partition):
$this->bbcode_second_pass_code('', '$ dd count=1k bs=1M if=/dev/zero of=/mnt/tumbler/test.img
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 58.7259 s, 18.3 MB/s')
NTFS drive 1:
$this->bbcode_second_pass_code('', '$ dd count=1k bs=1M if=/dev/zero of=/mnt/gannon/test.img
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 127.379 s, 8.4 MB/s')
NTFS drive 2:
$this->bbcode_second_pass_code('', '$ dd count=1k bs=1M if=/dev/zero of=/mnt/obelisk/test.img
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 138.751 s, 7.7 MB/s')
I think 18MBps for a USB drive isn't terrible but it's still well below the max speed for normal USB2 devices. The two NTFS drives are horrible. Could this be due to the overhead of ntfs-3g? This still doesn't explain why the samba transfer rate gets below 1MBps though. netter, do you have any ideas on what settings I should try tweaking?
GnuFlip
 
Posts: 7
Joined: Thu Jul 22, 2010 8:52 pm

Re: Very Slow Samba Shares

Postby netter » Fri Jan 07, 2011 2:17 pm

let me just picture your basics. you boot off of ext2, but the root is on ext3, both which are on the same physical drive. Nothing wrong with this just making sure, you're rootfs is seperate from other partitions from which you are sharing data.

1) All the drive speeds are fine, event he 7.7MB/s as samba drops it below anyways. Have you tried tweaking the tcp settings for the samba.conf file?

Although I dont have a dockstar, i have a tonido + their ubuntu rootfs, my top samba speeds for rw, are around 6.1MB/s so you definitely have room to grow, but again that's just what I got.

2) Can you check transfer speeds with other protocols, probably ftp.

3) optionally check transfer speeds of the router and see if that isn't the culprit, lan wise ofc.

edit:

4) your usb hub is powered right?
netter
 
Posts: 24
Joined: Thu Sep 30, 2010 1:22 am

Re: Very Slow Samba Shares

Postby moonman » Thu Jan 20, 2011 4:28 am

1. Free version of ntfs-3g is very CPU-intensive. Run top when you are copying files to see if the CPU is maxed out.
2. 10 MB/s seems to be maximum for samba due to protocol overhead maybe your NIC is not setup properly (100mbit nic).
3. do a speed test for your hdd
pacman -Sy hdparm
hdparm -t /dev/sd[X]

where [X] is your drive
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: Very Slow Samba Shares

Postby ygator » Thu Jan 20, 2011 5:31 am

I got 27.6 MB/s to a 500GB Seagate FreeAgent Go Drive formatted as ext3.
A flash drive is my root and the Go drive is mounted in the top dock.
$this->bbcode_second_pass_code('', '[root@dockstar go]# dd count=1k bs=1M if=/dev/zero of=test.img
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 38.9367 s, 27.6 MB/s

[root@dockstar go]# hdparm -t /dev/sda1

/dev/sda1:
Timing buffered disk reads: 88 MB in 3.04 seconds = 28.97 MB/sec
')
ygator
 
Posts: 97
Joined: Tue Aug 10, 2010 9:37 pm

Re: Very Slow Samba Shares

Postby moonman » Sun Jan 23, 2011 10:21 am

Did you follow the wiki to setup samba shares?

One important option in the example shown for smb.conf is this:
$this->bbcode_second_pass_code('', ' socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=131072 SO_SNDBUF=131072 SO_KEEPALIVE')

Increases speed dramatically.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: Very Slow Samba Shares

Postby genesc » Mon Feb 14, 2011 7:44 am

I have to say that I am also seeing very slow Samba performance. I'm doing a ftp transfer from one computer to my PC, and then from my PC to a Samba share that only averages around 500 KB/sec (though the transfer speed bounces around between 300 KB/sec and 750 KB/sec), when normally the transfer does 2.5 MB/sec to a disk not on my Pogoplug. I have a pink Pogoplug running Arch Linux ARM install (uname -a gives "Linux Arch Linux ARM install 2.6.36 #1 PREEMPT Wed Dec 8 01:07:33 CST 2010 armv5tel Feroceon 88FR131 rev 1 (v5l) Marvell SheevaPlug Reference Board GNU/Linux") with the latest Samba installed. NTP and Samba are the only packages I've installed. My target disk is formatted with ext3.

Among the things I've tried:

1. Swapping out the ethernet cable.
2. Adding swap to my hard drive (swapon -s says it's not even being used)
3. Reinstalling Arch Linux ARM install on a completely new USB flash disk in case my old one was worn out.

When I do a wget, I get transfer speeds of 1.8 MB/sec over the internet, so the basic TCP stack probably isn't the problem. This problem started about a month or so ago. At that time I could do at least the 2.5 MB/sec my ftp source could do (which was the gating item). Then for some reason it dropped down to about 1.5 MB/sec (though I can't remember changing anything). After I "upgraded" to the latest kernel, it's now down to the 500 KB/sec.

I've done Wireshark traces. Though I'm no expert on Wireshark, it looks like there are a bunch of data packets of 1460 bytes each from my PC to my Pogoplug, for a total of 64KB (there's only about 0.00002 sec between each packet). My Pogoplug then responds with a series of ACKs to my PC. Between each ACK from the Pogoplug there are several milliseconds, with some actually taking a hundredth of a second between ACKs. Obviously, if it takes several milliseconds to ACK a packet with a payload of 1460 bytes, the overall transfer speed is going to be very slow, and roughly corresponds to the 500 KB/sec I'm seeing. If my interpretation is correct, then something must be very broken in this implementation of Samba on my Pogoplug. Note, I've tried using the Samba options specified by moonman (in fact, I think they are the default).
genesc
 
Posts: 3
Joined: Sun Feb 13, 2011 8:58 pm

Re: Very Slow Samba Shares

Postby BinaryJay » Mon Feb 14, 2011 3:51 pm

Not exactly the same issue you're having but I am also puzzled at my Samba speed.

I can write TO my Samba share at approx 6 MB/s over powerline ethernet, but reading FROM the Samba share only achieves about 3.5 MB/s. I'm not sure why writing should be faster than reading...
BinaryJay
 
Posts: 87
Joined: Mon Dec 06, 2010 10:27 pm

Re: Very Slow Samba Shares

Postby pepedog » Mon Feb 14, 2011 4:28 pm

I got an apple usb nic (100 Mbps) facing the internal network (inbuilt nic feeding other stuff along with wireless access point) and get 8 meg bytes per second write, 10 read.
Just connected inbuilt nic direct to PC 1000Mbps nic (you can do that, no hub or switch required) and read went 10% better)
All I can do is show you config
$this->bbcode_second_pass_code('', '[global]
workgroup = TIGERDOM
server string = PBLINUX
interfaces = 192.168.2.0/24
log file = /var/log/samba/%m.log
max log size = 50
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=131072 SO_SNDBUF=131072 SO_KEEPALIVE
printcap name = cups
local master = No
dns proxy = No
wins server = 192.168.2.1
hosts allow = 192.168., 127.

[homes]
comment = Home Directories
read only = No

[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0770
guest ok = Yes
printable = Yes
browseable = No')
Dave
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Very Slow Samba Shares

Postby genesc » Wed Feb 16, 2011 2:34 am

This turns out to be a Arch Linux ARM install / Windows XP thing. I booted up Ubuntu 10.10 on the same PC, and transfers worked at full speed between the ftp source computer --> my PC --> the same disk on my Pogoplug. Transfers between a NTFS disk on my PC and the disk on my Pogoplug hit 10 MB/sec. I'm running XP Pro SP3 with all the latest patches.

I have no idea what's going on. In the past (but not recently) I've done Samba transfers to/from my PC to other servers and never seen this kind of slowdown. If Samba was working so poorly under XP in general you'd think there would be a huge outcry.

One thing. I said before that a wget from my Pogoplug to the internet worked at full speed, so probably the TCP/IP stack on the Pogoplug was OK. Looking at my Wireshark traces again, with their huge delays between TCP ACKs makes me wonder if the problem is at the TCP level after all. I'm certainly no expert on TCP or Samba, but it looks like Samba relies on basic TCP for data transfers, and then has a higher level Samba protocol for issuing read and write commands. What XP could be doing at the TCP level that has my Pogoplug all upset I don't know. It doesn't look like there's a bunch of retries, but again I'm no expert.
genesc
 
Posts: 3
Joined: Sun Feb 13, 2011 8:58 pm

PreviousNext

Return to User Questions

Who is online

Users browsing this forum: No registered users and 15 guests