> 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
peloy@ven.ra.rockwell.com
1998-Jul-26 16:53 UTC
Slowdown when copying large files (PR#8617)
Andrew Tridgell <samba-bugs@samba.anu.edu.au> wrote:> 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.Andrew, but if it is Windows 98 the one that is screwing things up, wouldn't this slowdown be seen when the server is something else, like Windows 95/NT, etc.? peloy.-
peloy@ven.ra.rockwell.com wrote:> > Andrew Tridgell <samba-bugs@samba.anu.edu.au> wrote: > > > 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. > > Andrew, but if it is Windows 98 the one that is screwing things up, > wouldn't this slowdown be seen when the server is something else, like > Windows 95/NT, etc.? >Apparently not - according to one of JohnT's technical contacts at MS - doing a fsync on a file in NT isn't the same as a UNIX fsync, but only *schedules the write to be done* ! I will add this option before 1.9.18p9 ships - the only question is - should it be on or off by default ? Cheers, Jeremy. -- -------------------------------------------------------- Buying an operating system without source is like buying a self-assembly Space Shuttle with no instructions. --------------------------------------------------------
--On Tuesday, July 28, 1998, 3:48 AM +1000 "Jeremy Allison" <jallison@cthulhu.engr.sgi.com> wrote: } >peloy@ven.ra.rockwell.com wrote: } > } > Andrew, but if it is Windows 98 the one that is screwing things up, } > wouldn't this slowdown be seen when the server is something else, like } > Windows 95/NT, etc.? } > } Apparently not - according to one of JohnT's technical } contacts at MS - doing a fsync on a file in NT isn't the } same as a UNIX fsync, but only *schedules the write to } be done* ! So it's more like the way NFS treats syncs. Eventually... :-) } I will add this option before 1.9.18p9 ships - the only } question is - should it be on or off by default ? Sounds to me like there are two issues. One, to make the behavior consistent with NT's, perhaps only flush the stream. But then, what if somebody _really_ wanted a sync done when SMB says to do one? Is that two options? Jim -- Jim Watt jimw@PE-Nelson.COM Perkin-Elmer Corporation Voice (desk): +1 408 577 2228 PE-Nelson Division Fax: +1 408 894 9307 3833 North First Street Voice (main): +1 408 577 2200 San Jose CA 95134-1701