[Samba] Saving files with MS Word to samba3 server is very slow!

Andreas Haumer andreas at xss.co.at
Thu Dec 1 16:55:29 GMT 2005


Hi!

I'm currently hunting a strange problem and looking for help!

I have a samba3 fileserver (currently samba-3.0.20b, but problem can
be reproduced with samba-3.0.7, but _not_ with samba2 like 2.2.8a),
and I see performance problems when writing files with MS word 2002 SP3
from a NT4.0 (SP6a) workstation. Saving even the smallest file takes more 
than 10 seconds! Copying files with Windows Explorer takes less than
a second!

Also, from Windows XP clients it takes less than a second when saving
files to the Samba server with Word!

I took various dumps with ethereal and found the following:

Time        Source                Destination           Protocol Info
9.906172    aaa.bb.ccc.130        aaa.bb.ccc.14         SMB      Write AndX
Request, FID: 0x2ed3, 162 bytes at offset 0
9.907359    aaa.bb.ccc.14         aaa.bb.ccc.130        SMB      Write AndX
Response, FID: 0x2ed3, 162 bytes
9.907734    aaa.bb.ccc.130        aaa.bb.ccc.14         SMB      NT Create AndX
Request, Path: \~$stdatei2.doc
9.907901    aaa.bb.ccc.14         aaa.bb.ccc.130        SMB      Locking AndX
Request, FID: 0x2ed3
9.908102    aaa.bb.ccc.130        aaa.bb.ccc.14         SMB      Locking AndX
Request, FID: 0x2ed3
9.938196    aaa.bb.ccc.14         aaa.bb.ccc.130        TCP      netbios-ssn >
rootd [ACK] Seq=105376 Ack=77857 Win=10220 Len=0
10.858462   aaa.bb.ccc.14         aaa.bb.ccc.130        SMB      NT Create AndX
Response, Error: STATUS_SHARING_VIOLATION
10.858852   aaa.bb.ccc.130        aaa.bb.ccc.14         SMB      Trans2 Request,
FIND_FIRST2, Pattern: \~$stdatei2.doc
10.858858   aaa.bb.ccc.14         aaa.bb.ccc.130        TCP      netbios-ssn >
rootd [ACK] Seq=105415 Ack=77973 Win=10220 Len=0
10.858983   aaa.bb.ccc.14         aaa.bb.ccc.130        SMB      Trans2
Response, FIND_FIRST2, Files: ~$stdatei2.doc
10.859612   aaa.bb.ccc.130        aaa.bb.ccc.14         SMB      NT Create AndX
Request, Path: \~$stdatei2.doc
10.898195   aaa.bb.ccc.14         aaa.bb.ccc.130        TCP      netbios-ssn >
rootd [ACK] Seq=105611 Ack=78093 Win=10220 Len=0
11.818364   aaa.bb.ccc.14         aaa.bb.ccc.130        SMB      NT Create AndX
Response, Error: STATUS_SHARING_VIOLATION
11.818717   aaa.bb.ccc.130        aaa.bb.ccc.14         SMB      NT Create AndX
Request, Path: \~$stdatei2.doc
11.818725   aaa.bb.ccc.14         aaa.bb.ccc.130        TCP      netbios-ssn >
rootd [ACK] Seq=105650 Ack=78213 Win=10220 Len=0
12.500990   aaa.bb.ccc.130        aaa.bb.ccc.14         SMB      Trans2 Request,
QUERY_PATH_INFO, Query File Basic Info, Path: \~WRD0005.tmp
12.501012   aaa.bb.ccc.14         aaa.bb.ccc.130        TCP      netbios-ssn >
rootd [ACK] Seq=105650 Ack=78319 Win=10220 Len=0
12.501243   aaa.bb.ccc.14         aaa.bb.ccc.130        SMB      Trans2
Response, QUERY_PATH_INFO, Error: STATUS_OBJECT_NAME_NOT_FOUND
12.631008   aaa.bb.ccc.130        aaa.bb.ccc.14         TCP      rootd >
netbios-ssn [ACK] Seq=78319 Ack=105689 Win=8682 Len=0
12.778367   aaa.bb.ccc.14         aaa.bb.ccc.130        SMB      NT Create AndX
Response, Error: STATUS_SHARING_VIOLATION
12.778636   aaa.bb.ccc.130        aaa.bb.ccc.14         SMB      Close Request,
FID: 0x2ed3
12.778797   aaa.bb.ccc.14         aaa.bb.ccc.130        SMB      Close Response
12.780195   aaa.bb.ccc.130        aaa.bb.ccc.14         SMB      Trans2 Request,
QUERY_PATH_INFO, Query File Basic Info, Path: \

aaa.bb.ccc.14 = Samba server, aaa.bb.ccc.130 = Windows NT workstation

As you can see, it takes the samba server always about a second
to respond to the client's request with a STATUS_SHARING_VIOLATION
message. This repeats several times even when saving a very small
file and so this sums up to more that 10 seconds when the file then
finally gets saved. Where does this delay come from? 

In the samba logfile I see many of the following messages:
[...]
[2005/12/01 17:25:40, 3] smbd/sec_ctx.c:set_sec_ctx(288)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2005/12/01 17:25:40, 3] smbd/sec_ctx.c:set_sec_ctx(288)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2005/12/01 17:25:40, 3] smbd/process.c:process_smb(1114)
  Transaction 566 of length 116
[2005/12/01 17:25:40, 3] smbd/process.c:switch_message(900)
  switch message SMBntcreateX (pid 4632) conn 0x8424c48
[2005/12/01 17:25:40, 3] smbd/sec_ctx.c:set_sec_ctx(288)
  setting sec ctx (5602, 5600) - sec_ctx_stack_ndx = 0
[2005/12/01 17:25:40, 3] smbd/dosmode.c:unix_mode(121)
  unix_mode(~WRD0005.tmp) returning 0744
[2005/12/01 17:25:40, 3] smbd/error.c:error_packet(147)
  error packet at smbd/trans2.c(2589) cmd=162 (SMBntcreateX)
NT_STATUS_SHARING_VIOLATION
[2005/12/01 17:25:40, 3] smbd/process.c:process_smb(1114)
  Transaction 567 of length 116
[2005/12/01 17:25:40, 3] smbd/process.c:switch_message(900)
  switch message SMBntcreateX (pid 4632) conn 0x8424c48
[2005/12/01 17:25:40, 3] smbd/dosmode.c:unix_mode(121)
  unix_mode(~WRD0005.tmp) returning 0744
[2005/12/01 17:25:40, 2] smbd/open.c:open_file(372)
  wunderli opened file ~WRD0005.tmp read=Yes write=No (numopen=4)
[2005/12/01 17:25:41, 3] smbd/sec_ctx.c:set_sec_ctx(288)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2005/12/01 17:25:41, 3] smbd/sec_ctx.c:set_sec_ctx(288)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2005/12/01 17:25:41, 3] smbd/process.c:process_smb(1114)
  Transaction 568 of length 116
[2005/12/01 17:25:41, 3] smbd/process.c:switch_message(900)
  switch message SMBntcreateX (pid 4632) conn 0x8424c48
[2005/12/01 17:25:41, 3] smbd/sec_ctx.c:set_sec_ctx(288)
  setting sec ctx (5602, 5600) - sec_ctx_stack_ndx = 0
[2005/12/01 17:25:41, 3] smbd/dosmode.c:unix_mode(121)
  unix_mode(~WRD0005.tmp) returning 0744
[2005/12/01 17:25:41, 3] smbd/error.c:error_packet(147)
  error packet at smbd/trans2.c(2589) cmd=162 (SMBntcreateX)
NT_STATUS_SHARING_VIOLATION
[2005/12/01 17:25:41, 3] smbd/process.c:process_smb(1114)
  Transaction 569 of length 116
[2005/12/01 17:25:41, 3] smbd/process.c:switch_message(900)
  switch message SMBntcreateX (pid 4632) conn 0x8424c48
[2005/12/01 17:25:41, 3] smbd/dosmode.c:unix_mode(121)
  unix_mode(~WRD0005.tmp) returning 0744
[2005/12/01 17:25:41, 2] smbd/open.c:open_file(372)
  wunderli opened file ~WRD0005.tmp read=Yes write=No (numopen=4)
[2005/12/01 17:25:42, 3] smbd/sec_ctx.c:set_sec_ctx(288)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2005/12/01 17:25:42, 3] smbd/sec_ctx.c:set_sec_ctx(288)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2005/12/01 17:25:42, 3] smbd/process.c:process_smb(1114)
  Transaction 570 of length 116
[...]

I already tried to disable oplocks, but this didn't help!

Please note that the problem does only occur with the combination 
of Samba 3, Windows NT and Word.

It does _not_ occur with:

Samba 2 server, Windows NT client, Saving file with Word
Samba 3 server, Windows NT client, Copying file with Explorer
Samba 3 server, Windows XP client, Saving file with Word


Does anyone have any idea how to solve this mystery?

Any help is appreciated!

Regards

- andreas


-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/



More information about the samba mailing list