From owner-freebsd-current@FreeBSD.ORG Wed Mar 28 10:03:16 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 04D8216A402 for ; Wed, 28 Mar 2007 10:03:16 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.187]) by mx1.freebsd.org (Postfix) with ESMTP id 8224513C448 for ; Wed, 28 Mar 2007 10:03:15 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: by mu-out-0910.google.com with SMTP id g7so3395805muf for ; Wed, 28 Mar 2007 03:03:14 -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:mime-version:content-type:content-transfer-encoding:content-disposition; b=YWkUYdvkNxep1lXvZYkLNjtUebqT+VOohspHDt/hL4DjapczzA3XIRlOXIIZbgt21wMt18vdjbeP2AMf7Qne9VHeQFHV9Cp9e0OPETVL3GEumf1KkVT/B92967RJbOUoXbvevBs4ChTUI7C4031E3ZOVO99h9r4dOwuU3l5/WT8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=K6iS9TRtyWf0h6Jy7dod+Eaqn4TWRy+F8QexG4PmEp9SV3ExTMmlKCl4C8toq7/A0JfPi964G2+7OMwEiTL7cGJeweygbG/KkDIv9wD/RuOrfZqtOcBWRqsDTXa5E2+zkUyZht3uaCX3qvpGy0ISsFz3CuWcF6h9B+Q1Wkuyg9w= Received: by 10.82.134.12 with SMTP id h12mr18493694bud.1175074724905; Wed, 28 Mar 2007 02:38:44 -0700 (PDT) Received: by 10.82.187.19 with HTTP; Wed, 28 Mar 2007 02:38:44 -0700 (PDT) Message-ID: <7ad7ddd90703280238r5dd3f30ftc1641926ecdf44a8@mail.gmail.com> Date: Wed, 28 Mar 2007 11:38:44 +0200 From: "Ulrich Spoerlein" To: current@freebsd.org, net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: Subject: 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: Wed, 28 Mar 2007 10:03:16 -0000 Hi, I observe a strange effect, when using the following setup: Three FreeBSD 6.2[1] machines on Gigabit Ethernet using em(4) interfaces. HostC is the NFS server, HostB has /net/share mounted from HostC. I will use HostA and HostB to demonstrate the issue. Picture this: hostA # scp 500MB hostB:/net/share/ Iff the file "500MB" does not yet exist on the NFS share, I can see X MB/s going out of HostA, X MB/s coming in on HostB, X MB/s going out on hostB again and finally X MB/s coming in on HostC. 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 <----- If I rm(1) the file on the NFS share, then the first scp(1) will not show this behaviour. It is only when overwritting files, that this happens. The real weirdness comes into play, when I simply cp(1) from HostB itself like this: hostB # cp 500MB /net/share/ I can do this over and over again, and _never_ get any noteworthy amount of NFS READ calls, only WRITE. The network traffic is also, as you would expect. Then I tested using ssh(1) instead of scp(1), like this: hostA # cat 500MB | ssh hostB "cat >/net/share/500MB" This works, too. Probably, because sh(1) is truncating the file? So, can someone please explain to me, what is happening and if/how it can be avoided? Cheers, Uli [1] I know this is current, but on stable@ nobody picked up the thread, so I'll try my luck here.