LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-09-2013, 07:07 AM   #1
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 269

Rep: Reputation: 25
Samba hell - asymmetric network speed


I'm setting up windows file sharing on a debian wheezy headless system (NAS). The problem is that for some reason samba upload speed is ridiculously slow. Don't get me wrong, the the download speed (copying a file from the remote network share to my laptop) is completely normal - about 9MB/s which is as much as a 100 MBIT Ethernet can handle. It's just the upload speed (copying file from laptop to remote share) that is slow - about 1.8MB/s. I have no idea what's causing it. The NAS and my laptop are both connected via an ethernet cable to the same switch.

The upload used to work fine before, but then it suddenly dropped, and now it's permanently this slow. I've tried to reboot my NAS, I've tried to reboot the laptop, I've tested the network speeds from multiple laptops and a stationary computer with the same results. I've even tried different operating systems - linux, Windows XP and Windows 7. Nothing helped. I've changed the switch and the ethernet cable for a shorter and shielded CAT6, I've changed the server smb.conf multiple times with various settings/tweaks + restarted samba service. I've changed the OS kernel, I've even done a fresh install of the OS for the purpose of debugging this problem.

Here's my smb.conf:
Code:
[global]
    # Server settings
    workgroup = DISPLACE
    server string = My File Server
    netbios name = NAS-12345
    
    # Networking settings
    interfaces = lo 0.0.0.0 ::
    bind interfaces only = no
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
    name resolve order = bcast host lmhosts wins
    os level = 65
    dns proxy = no
    
    # Log settings
    log file = /var/log/samba/log.%m
    max log size = 10000
    syslog = 1
    log level = 2
    
    # Security settings
    security = user
    encrypt passwords = true
    passdb backend = tdbsam
    
    # Guest access is allowed, but with read-only permissions
    guest account = nobody
    map to guest = Bad User
    
    # We don't want the printers to show up on the shares
    load printers = no
    printing = bsd
    printcap name = /dev/null
    disable spoolss = yes
    
    # Symlinks are allowed
    follow symlinks = yes
    wide links = yes
    unix extensions = no
    
    # No peeking about!
    hide unreadable = yes
    hide special files = yes

[Storage]
    comment = Data storage device
    path = /tmp
    browsable = yes
    read only = no
    public = yes
    create mask = 0644
    directory mask = 0755
    force create mode = 0664
    force directory mode = 0775
So far I know it's not a hardware problem because samba upload used to work normally before, and the fact that the FTP transfers work at full speed in both directions.

The only promising discovery I've made is this: I've installed debian wheezy afresh, booted the device (it was connected to LAN) and immediately installed samba, samba-tools and samba-common-bin with apt-get. Next I've replaced /etc/samba/smb.conf with my own (see above), and set it to export a single public share that pointed to rwx-rwx-rwx /tmp that was mounted as tmpfs in ram. Finally I restarted samba service and tested the network speeds with my fingers crossed. Voila! Uploads and downloads were working again with full speeds (about 9MB/s each).

And here's the bizzare thing. After testing the network speed I rebooted the device and re-tested the network speed. Arghhh! The upload speed now dropped back to 1.8MB/s. WTH??? No matter how many times afterwards I rebooted the device the upload speed would stay this slow. Clearly this is not a samba config problem. What could have caused samba to reduce the upload speed in that first reboot???


Any ideas?

EDIT: I was trying this out at another place, but I just brought the device back home and ran the same tests again. The full upload speed worked again! Then I rebooted the device, and it slowed down to a crawl again no matter how many times I rebooted.

There's more. I found out that if you reboot nothing happens. But if you remove the device from power for a while and boot then the full speed works again. It stops after the first soft reboot. Even after unplugging from power and booting up again the upload will slow to a crawl after I issue the command "service networking restart". Before that everything works ok.

EDIT 2: The device gets a new IP address each time it is unplugged from power, but retains the same IP during soft reboots.

EDIT 3: Does not seem to be relevant. The device got a new random mac address each reboot. For some reason it kept the IP address during soft reboots, but not during power cuts. I've fixed the device's mac address to a static one, and now it doesn't change any more during reboots, and neither does the IP address. The samba network speed still drops after first reboot/networking restart.

EDIT 4: I think I've figured out what was causing the problem. Since this was on a cubieboard ARM board, it appears that updating the kernel has fixed the problem. Apparently the ethernet driver was too unstable. The solution is to update to a more recent kernel. I am using the sunxi-3.4 branch (3.4.61) from the linux-sunxi github repository.

Last edited by displace; 09-16-2013 at 02:25 PM.
 
Old 09-10-2013, 12:25 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,206

Rep: Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537Reputation: 2537
It sounds like something is falling back to 10mb or else losing loads of packets. Is it getting encrypted?

Anyhow, I would relax about the software. My guess is your problem is on the connection - cabling, plugs or some such. Eliminate that before you go playing more with software.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How the hell do I add a network (samba) printer? redbird Linux - Networking 2 09-24-2009 04:48 PM
Wierd Samba Problem with Network Speed (using SK98lin driver) g8keepR Linux - Networking 5 02-10-2005 10:21 PM
Is there a tool to monitor Internet connection speed and also network speed? xleft4dexy Linux - Networking 4 10-14-2003 11:29 PM
Samba Hell TrashCanMan Linux - Networking 3 07-14-2003 01:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration