Click to See Complete Forum and Search --> : Slow samba connection


Espen
02-27-2004, 07:09 AM
Hi.

I have a Celeron 366 machine running Red Hat 8 (stock kernel) and samba 3.0.2a-1.
My problem is that when I access a share it takes about 20 seconds to open the shared folder, but once I'm in it's as fast as if the disk was on my own computer.

Here is my smb.conf file:
[global]

workgroup = Quad-Network
server string =
printcap name = /etc/printcap
load printers = no
printing = lprng
log file = /var/log/samba/%m.log
max log size = 0
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
unix password sync = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*success fully*
pam password change = yes
obey pam restrictions = yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
local master = no
dns proxy = no

[homes]
comment = Home Directories
browseable = no
comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775


I've tried it while the firewall is dissabled, and the problem isn't in the windows (XP) machines that are accessing it, since there are two more Linux machines running samba that work fine.
Can anyone help?

cowanrl
02-27-2004, 05:40 PM
Many times those delays when you first access a share are caused by name lookup problems. Try adding this line to your smb.conf file:

name resolve order = bcast host lmhosts wins

That will force Samba to try a broadcast first to try and resolve names on the network.

If you have more than one IP subnet on your network, you may want to try and add the names of the computers on your network into the lmhosts or host files on the Samba server. The default for the name resolve order is:

name resolve order = lmhosts host wins bcast

so it would use the entries in the lmhosts or host file first for name resolution.

Espen
02-28-2004, 04:19 PM
Thank you for your reply.
I tried to enter those in my smb.conf file and noticed that when I now turn off my firewall the delay has been reduced to about 1-2 seconds.
The next question is: why does the firewall delay the process so much on "initial contact"? Are there any specific ports that should be open (besides 137-139 UPD and TCP)?

cowanrl
02-28-2004, 05:26 PM
Yes. You'll also want to open up TCP and UDP ports 445. Win2k and XP can also use these ports for communications. Samba also supports these ports.

Espen
02-29-2004, 05:59 PM
Hmm. That didn't help. Could it be an issue with the version of iptables (1.2.6a-2) or the kernel? I would like to compile a 2.6.x kernel, but I don't know how to compile it with the driver for my SATA controller (Adaptec 1210SA). Or could it be an issue with the CPU being to slow?