Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

SMB Share Connection Timeout

Does OSX auto disconnect or timeout an existing SMB connection after some time of inactivity? The reason is because when I connect to my SMB share (hosted on OSX Server 10.5), I open a file to edit it directly from the network drive. If I spend like an hour modifying this file, then try to save it, it won't save at all. Whereas if I only spend a minute or so, then I can save just fine.


If OSX does auto disconnect me from my SMB drive, is there a command line to extend this delay, either on the client side or on server side?

Posted on Sep 21, 2011 12:43 PM

Reply
Question marked as Best reply

Posted on Sep 24, 2011 4:43 AM

sysctl net.smb.fs


reveals some timeouts, one seems to be set to 10 minutes, might be worth some testing.

6 replies

Sep 28, 2011 10:14 AM in response to Mojo66

I am having a problem where XP machines are getting a "Delayed Write Failed" on a mapped network drive which of course has no capabillity of caching. I think it's related to the SMB connection being dropped every 10 minutes. When I look a the console at the timestamp when a user gets that message I see an entry for that user "connecting" to the share. So I think the file save must time out while windows is trying to re-establish the connection to the mapped drive.


In sysctl net.smb.fs I see "net.smb.fs.kern_deadtimer: 60" and "net.smb.fs.kern_hard_deadtimer: 600"


Does anyone have any information on these values? Where they come from and if it's ok to change them? What is the max or minimum they can be set to?

Oct 4, 2011 10:41 AM in response to rageguy

Ok. I found and fixed the problem my Windows XP clients were having. If you recall they would get a "Delayed Write Failed" and end up with corrupt files. It turned out to be Opprotunistic Locking on the client machines. There is a pretty good artilce about Server Message Block (SMB) on wikipedia. I think it does a good job of describing why Opportunistic Locking and Unix don't always get along.


http://en.wikipedia.org/wiki/Server_Message_Block#Opportunistic_locking


and a MS Knowledgebase article tells how to disable it. I don't know that this will help you with your issue but I thought I would post the fix and related links.


http://support.microsoft.com/kb/296264


Edit: I have not had this same problem on my Windows 7 Pro workstation. I think they introduced SMB2 in Vista and it does not seem to have the same issues as SMB. I have not had any of these issues with a Snow Leopard server, just Lion. Apple replaced SAMBA with their own code in Lion because the SAMBA license agreement was changed.


Message was edited by: JeffB1079

Oct 4, 2011 10:45 AM in response to JeffB1079

Thanks. To be honest, I have only tested the client side on OSX 10.6 computers. You are most likely right that Windows 7 may not have the issue, because here in my workplace, it doesn't seem like any Windows users are complaining. It appears that only OSX clients are getting the disconnects.


A bandaid workaround would be to write a program that writes to the SMB server every minute or so, to keep alive. I think I may go this route.

SMB Share Connection Timeout

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.