LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-17-2015, 08:19 PM   #1
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Rep: Reputation: 19
Samba connection REALLY SLOW... Can someone help optimize please?


/etc/samba/smb.conf: http://pastebin.com/jjuz6MHn

I've setup a media server and converted all of my movies to the server. I run XBMC at my TV and have been for the last 5 years or so. But, I've been running it under Linux Mint and I've just switched to Fedora. I finally got samba working properly but it is taking for ever to establish a connection.

Previously, in XBMC it would take 3-4 seconds from when you selected a source to seeing the listing of files. Now, under the Fedora setup it is taking up to 30+ seconds to establish the same connection. So, needless to say, navigating around XBMC is painfully slow.

I need to speed up SMB. It's gotta be something in the server setup because previously it was working well.

The same delay exists if I try to connect to the share from another computer (i.e. Windows box).

Any help is much appreciated.
 
Old 03-18-2015, 01:10 AM   #2
zafar_dandoti
Member
 
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178

Rep: Reputation: 13
add in smb.conf file
Code:
socket options= TCP_NODELAY
restart samba
test..
 
Old 03-18-2015, 08:13 AM   #3
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
I found a book online for tuning Samba and have already updated my smb.conf file with that option without any success. Here is my current smb.conf: http://pastebin.com/Z688YNm1

I have restarted smb.service and nmb.service and rebooted the xmbc client. The connection issues are still there and very slow.
 
Old 03-18-2015, 11:25 PM   #4
zafar_dandoti
Member
 
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178

Rep: Reputation: 13
Is firewall running? If it is then disable it and try.
Also i would like to know how u r connected i mean, through router/firewall or a switch,what network hardware u rusing

Last edited by zafar_dandoti; 03-18-2015 at 11:29 PM.
 
Old 03-18-2015, 11:38 PM   #5
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
Yes the firewall is running but I *think* I have opened the port.

however... If it was the firewall, wouldn't it block it completely and not just slow it down? The connection is successful but it just takes awhile.

Also...

Testings seems to result in faster connections when I use smb://COMP-NAME/share-name insteald of smb://192.168.1.166/share-name

Not sure what that would make a difference. You think the IP address would be quicker.

There is no delay with pinging each system.

Is there a way I can just turn off the authentication all together with samba? No username/password required?
 
Old 03-19-2015, 12:00 AM   #6
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
OK... For testing purposes I've done more steps:

1. SELinux is already disabled so that is definitely not the issue.

2. I ssh'd into the xbmc box and used the following command: smbclient //192.168.1.166/movies
- the password prompt displays immediately
- after entering the password it takes 18 seconds to show the smb prompt at which I can display the contents of the share.

3. I re-ran the following command: smbclient //MSI-DESKTOP/movies
- the password prompt displays immediately
- after entering the password it still took 18 seconds to produce the smb prompt

4. I turned off the firewall on the server and retried steps 2 & 3 with the exact same results.

With regards to the SSH delay. I logged into the XBMC boxes and set SSH to UseDNS no and that solved the problem.

This leads me to think that the issue is being caused by DNS. However, I don't have the first clue how to test or setup DNS on a desktop machine. It is running as a samba server but I wouldn't think that since all my smb shares are connecting via IP addresses that I even have to worry about DNS. That say, I don't want to install BIND to get this working. It wasn't installed on my Linux Mint machine so it doesn't make any sense to me that it needs to be installed on this one.

Any further help would be greatly appreciated.
 
Old 03-19-2015, 02:06 AM   #7
zafar_dandoti
Member
 
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178

Rep: Reputation: 13
ok then u can do one thing add hosts to /etc/host file
Code:
ip address hostname
Then in smb.conf file add
Code:
name resolv order= hosts dns wins
restart samba
no need to setup bind dns if only couple if system participatingin network

Last edited by zafar_dandoti; 03-19-2015 at 02:08 AM.
 
Old 03-19-2015, 09:06 AM   #8
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
Code:
> cat /etc/hosts
127.0.0.1		localhost.localdomain localhost
::1		localhost6.localdomain6 localhost6
Ok... Here is the information:

Media Server: 192.168.1.166 ($ hostname returns: MSI-DESKTOP.thornton.local)
XBMC Box 1: 192.168.1.240 ($ hostname returns: xbmc-nT435-nT535)
XBMC Bos 2: 192.168.1.245 ($ hostname returns: xbmc-Aspire-M5630)

So... What should I put in the hosts file?

And then, once it is in the hosts file, what do I put for the address of the share? Right now I'm connecting with smb://192.168.1.166/share-name
 
Old 03-19-2015, 11:43 AM   #9
zafar_dandoti
Member
 
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178

Rep: Reputation: 13
Set proper hostnames first in /etc/sysconfig/network
on desktop HOSTNAME=desktop.thornton.local
On xbmc
HOSTNAME=XBMC1.thornton.local
then edit respective hosts file
and add
192.xx.xx.xx desktop desktop.thornton.local
192.xx.xx.xx xbmc1 xbmc1.thornton.local
Add all ip and fqdn host to respective hosts file on each hosts.
Reboot hosts.
Then try by cinnecting to share by computer name instead of ip

Stange, i have never experience slow network browsing with samba.
I just open ports 137tcp/udp,138udp,139tcp/udp and 445tcp and alloe selinux to permit access.
That always work for me.

Last edited by zafar_dandoti; 03-19-2015 at 11:54 AM.
 
Old 03-19-2015, 12:09 PM   #10
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
All it says in that file is # Created by anaconda

There are no contents. Do I just add HOSTNAME=desktop.thornton.local

??
 
Old 03-19-2015, 12:35 PM   #11
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,296

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
From the man page,

Quote:
IP_address canonical_hostname [aliases...]
Its a simple text file, three entries per line. One line per host. IP address of the host, canonical_hostname , alias.

Don't use commas between entries, just a space. Alias is an option.
 
Old 03-19-2015, 01:17 PM   #12
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
I think you are referring to the HOSTS file, correct?

I'm referring to the /etc/sysconfig/network file that you referenced.
 
Old 03-19-2015, 01:48 PM   #13
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
Here are the changes:

XBMC Box 1 --> Running Ubuntu 12.10
Code:
$ cat /etc/hosts
127.0.0.1	localhost thornton.local
192.168.1.245   xbmc-mainfloor xbmc-mainfloor.thornton.local
192.168.1.166   msi-desktop.thornton.local

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Code:
$ cat /etc/hostname
xbmc-mainfloor
SERVER ---> Running Korora 21
Code:
> cat /etc/hostname
msi-desktop.thornton.local
Code:
> cat /etc/hosts
127.0.0.1		msi-desktop.thornton.local localhost
::1		localhost6
I have a feeling that is REALLY WRONG! But, if you can tell me what I did wrong that would be greatly appreciated.
 
Old 03-19-2015, 11:52 PM   #14
zafar_dandoti
Member
 
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178

Rep: Reputation: 13
Did u try connecting to the share with name.
If it is same as before just try connecting ur xbmc and media server directly using cross over cable whithout switch/hub or router in between.

Last edited by zafar_dandoti; 03-20-2015 at 12:11 AM.
 
Old 03-20-2015, 02:28 AM   #15
zafar_dandoti
Member
 
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178

Rep: Reputation: 13
I fear samba is not reason for slowness but networking hardware is cousing trouble
 
  


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
Samba share slow lan connection; help! dowakeen Linux - Server 13 05-10-2013 01:33 PM
how to optimize samba performance? silent2k Linux - Server 2 01-09-2011 01:08 AM
How to optimize Linux internet connection ahmed_as8 Linux - Newbie 1 01-10-2009 09:00 AM
Samba - Losing connection and slow moffen Linux - Networking 1 01-18-2006 07:29 PM
New Fedora Internet connection slow slow slow matrim Fedora 9 07-29-2005 01:39 PM

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

All times are GMT -5. The time now is 01:56 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