Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
03-17-2015, 08:19 PM
|
#1
|
Member
Registered: May 2007
Posts: 430
Rep:
|
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.
|
|
|
03-18-2015, 01:10 AM
|
#2
|
Member
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178
Rep:
|
add in smb.conf file
Code:
socket options= TCP_NODELAY
restart samba
test..
|
|
|
03-18-2015, 08:13 AM
|
#3
|
Member
Registered: May 2007
Posts: 430
Original Poster
Rep:
|
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.
|
|
|
03-18-2015, 11:25 PM
|
#4
|
Member
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178
Rep:
|
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.
|
|
|
03-18-2015, 11:38 PM
|
#5
|
Member
Registered: May 2007
Posts: 430
Original Poster
Rep:
|
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?
|
|
|
03-19-2015, 12:00 AM
|
#6
|
Member
Registered: May 2007
Posts: 430
Original Poster
Rep:
|
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.
|
|
|
03-19-2015, 02:06 AM
|
#7
|
Member
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178
Rep:
|
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.
|
|
|
03-19-2015, 09:06 AM
|
#8
|
Member
Registered: May 2007
Posts: 430
Original Poster
Rep:
|
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
|
|
|
03-19-2015, 11:43 AM
|
#9
|
Member
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178
Rep:
|
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.
|
|
|
03-19-2015, 12:09 PM
|
#10
|
Member
Registered: May 2007
Posts: 430
Original Poster
Rep:
|
All it says in that file is # Created by anaconda
There are no contents. Do I just add HOSTNAME=desktop.thornton.local
??
|
|
|
03-19-2015, 12:35 PM
|
#11
|
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
|
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.
|
|
|
03-19-2015, 01:17 PM
|
#12
|
Member
Registered: May 2007
Posts: 430
Original Poster
Rep:
|
I think you are referring to the HOSTS file, correct?
I'm referring to the /etc/sysconfig/network file that you referenced.
|
|
|
03-19-2015, 01:48 PM
|
#13
|
Member
Registered: May 2007
Posts: 430
Original Poster
Rep:
|
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.
|
|
|
03-19-2015, 11:52 PM
|
#14
|
Member
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178
Rep:
|
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.
|
|
|
03-20-2015, 02:28 AM
|
#15
|
Member
Registered: Dec 2005
Location: India
Distribution: centos
Posts: 178
Rep:
|
I fear samba is not reason for slowness but networking hardware is cousing trouble
|
|
|
All times are GMT -5. The time now is 01:56 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|