Slowdown when copying large files (PR#8617)

Andrew Tridgell samba-bugs at samba.anu.edu.au
Sun Jul 26 14:41:00 GMT 1998


> Further to my previous post, I have made an interesting discovery.  This
> particular slowdown only occurs from clients that are running 
> Windows 98.

The Windows98 explorer (and possibly other programs) incorrectly set the
"sync" bit in write requests to network shares. This causes an enormous
slowdown as Samba (quite correctly) does a fsync() on the file after each
write. Combine this with the fact that Windows98 explorer uses very small
write sizes (around 1.5k) and you get really terrible results.

The only way to work around this at present is to add:

	#define NO_FSYNC 1

in local.h and recompile Samba. This should give you an enormous speedup.
In one test I did tonight a speedup of a factor of 15 was observed.

As I have not yet witnessed a Windows program using the fsync bit correctly
(they all seem to treat it like flush, which is a quite different thing!)
you don't actually lose anything by doing this. The sync is only useful
for transactional systems where a particular state of a file needs to be
guaranteed in the case of a server crash. I suspect what these programs
really want is a flush, which Samba does implicitly on every write anyway.

I have raised the possibility of adding a runtime config option to
disable fsync on the samba-technical list.

	Cheers, Tridge




More information about the samba mailing list