From owner-freebsd-fs@FreeBSD.ORG Wed Jan 11 19:30:02 2012 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02A29106566B for ; Wed, 11 Jan 2012 19:30:01 +0000 (UTC) (envelope-from mi+thun@aldan.algebra.com) Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102]) by mx1.freebsd.org (Postfix) with ESMTP id 67C138FC08 for ; Wed, 11 Jan 2012 19:30:01 +0000 (UTC) Received: from mr16.lnh.mail.rcn.net ([207.172.157.36]) by smtp02.lnh.mail.rcn.net with ESMTP; 11 Jan 2012 14:29:57 -0500 Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr16.lnh.mail.rcn.net (MOS 4.3.4-GA) with ESMTP id BNG69753; Wed, 11 Jan 2012 14:29:57 -0500 Received-SPF: None identity=pra; client-ip=209.6.61.133; receiver=smtp01.lnh.mail.rcn.net; envelope-from="mi+thun@aldan.algebra.com"; x-sender="mi+thun@aldan.algebra.com"; x-conformance=sidf_compatible Received-SPF: None identity=mailfrom; client-ip=209.6.61.133; receiver=smtp01.lnh.mail.rcn.net; envelope-from="mi+thun@aldan.algebra.com"; x-sender="mi+thun@aldan.algebra.com"; x-conformance=sidf_compatible Received-SPF: None identity=helo; client-ip=209.6.61.133; receiver=smtp01.lnh.mail.rcn.net; envelope-from="mi+thun@aldan.algebra.com"; x-sender="postmaster@utka.zajac"; x-conformance=sidf_compatible X-Auth-ID: anat Received: from 209-6-61-133.c3-0.sbo-ubr1.sbo.ma.cable.rcn.com (HELO utka.zajac) ([209.6.61.133]) by smtp01.lnh.mail.rcn.net with ESMTP; 11 Jan 2012 14:29:56 -0500 Message-ID: <4F0DE332.5040804@aldan.algebra.com> Date: Wed, 11 Jan 2012 14:29:54 -0500 From: "Mikhail T." User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:7.0.1) Gecko/20111013 Thunderbird/7.0.1 MIME-Version: 1.0 To: Bob Friesenhahn References: <1235110182.47136.1326298038118.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: X-Mailman-Approved-At: Wed, 11 Jan 2012 20:03:26 +0000 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: fs@freebsd.org Subject: Re: How to best send files over network? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 19:30:02 -0000 On 11.01.2012 13:29, Bob Friesenhahn wrote: > Yes, I am definitely talking about the receive (or the writing end). Well, this topic is of no concern to me right now -- I'm sending to clients already written (and embedded in firmwares), hence the explicit subject line :-) > The main advantage of using sendfile() seems to be to keep the file data from > needing to transit a user-space program. This is a noble goal but > circumstances have changed (i.e. bottlenecks have moved) since sendfile() was > invented. Even if other things involved in sending a file cost more, memory copying is still not free... > If FreeBSD sendfile is using memory mapping in its implementation, then that > is definitely bad for zfs. In September K. Macy claimed on this mailing list, that sending from mmap is over twice faster than sendfile, if the file is on ZFS: http://freebsd.1045724.n5.nabble.com/ZFS-lighttpd2-sendfile-too-high-IO-td4793886.html Bob replied to that, actually, so he must remember the discussion :) Though I find this sorry state of sendfile() rather disheartening, reading the above thread got me thinking about using a different method for different filesystems. But if mmap/write is never (i.e. for both UFS and ZFS) any worse than sendfile, then I can simply always use mmap in all cases. And this is, what I wanted to discuss -- I thought, in some cases, sendfile can arrange for data to go from the disk controller to the network card directly... Yours, -mi