Date: Thu, 29 Mar 2007 10:19:34 +0200 From: "Ulrich Spoerlein" <uspoerlein@gmail.com> To: "Bruce Evans" <bde@zeta.org.au> Cc: current@freebsd.org, net@freebsd.org Subject: Re: NFS write() calls lead to read() calls? Message-ID: <7ad7ddd90703290119i34b78d45s807659527d14478@mail.gmail.com> In-Reply-To: <20070329080917.B3626@besplex.bde.org> References: <7ad7ddd90703280238r5dd3f30ftc1641926ecdf44a8@mail.gmail.com> <20070329080917.B3626@besplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 3/29/07, Bruce Evans <bde@zeta.org.au> wrote: > On Wed, 28 Mar 2007, Ulrich Spoerlein wrote: > > > hostA # scp 500MB hostB:/net/share/ > > ... > > If I run the scp again, I can see X MB/s going out from HostA, 2*X > > MB/s coming in on HostB and X MB/s out plus X MB/s in on HostC. What's > > happening is, that HostB issues one NFS READ call for every WRITE > > call. The traffic flows like this: > > > > -----> -----> > > A B C > > <----- > > At least under FreeBSD-~5.2 with an old version of scp, this is caused > by blocksize bugs in the kernel and/or scp, and an open mode bug or > feature in scp. The blocksize used by scp is 4K. This is smaller > than the nfs block size of 8K, so nfs has to read-ahead 1 8K block for > each pair of 4K- blocks written so as to have non-garbage in the top > half of each 8K- block after writing 4K to the bottom half. It only > has to read-ahead if there is something there, but repeated scp's > ensure this by not truncating the file on open (open mode (O_WRONLY | > O_CREAT) without O_TRUNC according to truss(1)). > > [snip - all you ever wanted to know about block sizes] Thanks for the in-depth answer, Bruce. Greatly appreciated. I can now tweak all kinds of block sizes to make the final combination of Windows 2003, Samba and NFS work well. I hope that samba can be adjusted in the right places for this task. I'll post a summary, once I have it working. It seems that other people don't have these problems (as they are not running SMB+NFS) Uli
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7ad7ddd90703290119i34b78d45s807659527d14478>