2

When I first connect to the samba share from any windows client, it is very slow. But once it's open, it becomes fast until I leave the connection unused for a while. Are there any settings which need changing to sort this out?

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
psp
  • 3,173
  • 3
  • 15
  • 14

1 Answers1

0

That sounds like Samba and the Windows clients are taking a while negotiating the initial connection. Windows quietly closes unused connections in the background, which is why you're seeing the slow-downs after things have been unused; Windows is re-opening a connection. The two biggest areas that cause problems here are:

  1. Authentication delays. Whatever the Samba server is using for authentication is slow for some reason. Samba can use several back-ends, each one with their own possible delays.
  2. Protocol negotiation delays. Less common these days, but if the Samba server and the Windows clients take a while to figure out a common auth protocol, it can be visible. One possible source of problems is if you've configured Kerberos auth incorrectly and it's failing back to NTLMv2.
sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
  • Any ideas on how to fix this then? – psp Mar 06 '11 at 16:40
  • @psp I'll need more data before I can help. What are you using for an authentication back-end? What Windows versions are your clients? – sysadmin1138 Mar 06 '11 at 16:49
  • @sysadmin1138 Clients are Windows7. I create a new smbuser by using: "smbpasswd". – psp Mar 06 '11 at 17:00
  • If the `passdb backend` in `/etc/samba/smb.conf` is tdbsam, it can be slow if you have more than 250 users in there. Also, the `tdbsam` back-end will query `/etc/passwd` for account information; if passwd *does not contain the user* this could be the source of your slowdowns. – sysadmin1138 Mar 06 '11 at 17:10
  • passwd - does contain the users and the database has well under 250 users – psp Mar 06 '11 at 17:16
  • Then it sounds like authentication delays are not your problem. On to protocol negotiation. If the Lan Man Authentication Level on your Win7 clients is set to the default ("NTLMv2 only, deny LM/NTLM") then `ntlm auth=no` and `lanman auth=no` in your smb.conf file may make connections go faster as it reduces the number of protocols Samba has to negotiate. But, if it makes it stop working entirely, then we know that something is getting in the way of NTLMv2 auth and it was failing back to NTLM. – sysadmin1138 Mar 06 '11 at 17:31
  • No - that hasn't made a difference. I am still experiencing the same time delays. – psp Mar 06 '11 at 17:43
  • @psp Then you're into 'unusual areas of concern' and beyond what I can do from here. Sorry. – sysadmin1138 Mar 06 '11 at 17:45