Re: NFS write() calls lead to read() calls?



On 3/29/07, Bruce Evans <bde@xxxxxxxxxxx> 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
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: NFS write() calls lead to read() calls?
    ... 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. ... If I rmthe file on the NFS share, then the first scpwill not ... MAXBSIZE = 64K for large regular files and all non-regular files. ...
    (freebsd-net)
  • Re: NFS write() calls lead to read() calls?
    ... 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. ... If I rmthe file on the NFS share, then the first scpwill not ... MAXBSIZE = 64K for large regular files and all non-regular files. ...
    (freebsd-current)
  • Re: nfs is very slow
    ... > all ather protocols (ftp, http, scp) are quite fast. ... I've managed to boost my NFS performance to around 1.7MB/s (much more ... kernel server, rebuilding the kernel on my server & clients for NFS ...
    (Debian-User)
  • Re: NFS write() calls lead to read() calls?
    ... that HostB issues one NFS READ call for every WRITE ... At least under FreeBSD-~5.2 with an old version of scp, ... ensure this by not truncating the file on open (open mode (O_WRONLY | ... Samba and NFS work well. ...
    (freebsd-current)
  • Re: backing up recovery area in 10gR2...
    ... space there (nfs, ftp upload, scp or similar things). ... There is actually a white paper done by netapp and oracle detailing ...
    (comp.databases.oracle.server)