From owner-freebsd-current@FreeBSD.ORG Thu Mar 29 08:19:37 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 055C216A404 for ; Thu, 29 Mar 2007 08:19:37 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by mx1.freebsd.org (Postfix) with ESMTP id 8C9D113C459 for ; Thu, 29 Mar 2007 08:19:36 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: by nf-out-0910.google.com with SMTP id k27so98709nfc for ; Thu, 29 Mar 2007 01:19:35 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EX0QeltM3FumVn335cZ9oUIz0Pahb4uigLFmM/UmgJe9YPICDVs1rLuu+L7PhvSb8GP7rE8wz4g1jIuKeDYNFVaBWZPsoTDJCNkOH/KMG2Y35K+Hkba3EPfG3x3fUZxe/4hwqK1w3EzLuAzZrHLrYT/VzNM3zxu8MN/DOR0keKw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XD7m+S9QJkqL+sJghHZjVnl+6sXEmIe8TM9N8C4yQg6Jofs+dFfuM9bXogV2Z2rjske1DqNou+9ykcDCZ7MhxZ21hSYQ0rY4JyozONeeesDai2NkrDHqa961dZkx6FZI1dpn2nmMT3rXINtb5FlG1kOqsaHxoMvQQp5MP47m/eI= Received: by 10.82.104.18 with SMTP id b18mr918304buc.1175156374237; Thu, 29 Mar 2007 01:19:34 -0700 (PDT) Received: by 10.82.187.19 with HTTP; Thu, 29 Mar 2007 01:19:34 -0700 (PDT) Message-ID: <7ad7ddd90703290119i34b78d45s807659527d14478@mail.gmail.com> Date: Thu, 29 Mar 2007 10:19:34 +0200 From: "Ulrich Spoerlein" To: "Bruce Evans" In-Reply-To: <20070329080917.B3626@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7ad7ddd90703280238r5dd3f30ftc1641926ecdf44a8@mail.gmail.com> <20070329080917.B3626@besplex.bde.org> Cc: current@freebsd.org, net@freebsd.org Subject: Re: NFS write() calls lead to read() calls? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2007 08:19:37 -0000 On 3/29/07, Bruce Evans 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