Re: [hybi] Background info: Properties of sendfile()

"Roy T. Fielding" <fielding@gbiv.com> Fri, 06 August 2010 01:09 UTC

Return-Path: <fielding@gbiv.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 9EEF83A6893 for <hybi@core3.amsl.com>; Thu, 5 Aug 2010 18:09:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.399
X-Spam-Level:
X-Spam-Status: No, score=-105.399 tagged_above=-999 required=5 tests=[AWL=-2.800, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1v8ZP0tmoovA for <hybi@core3.amsl.com>; Thu, 5 Aug 2010 18:09:03 -0700 (PDT)
Received: from spaceymail-a1.g.dreamhost.com (caibbdcaaaaf.dreamhost.com [208.113.200.5]) by core3.amsl.com (Postfix) with ESMTP id BFDCF3A6782 for <hybi@ietf.org>; Thu, 5 Aug 2010 18:09:03 -0700 (PDT)
Received: from di-524.corp.day.com (wsip-98-189-13-228.oc.oc.cox.net [98.189.13.228]) by spaceymail-a1.g.dreamhost.com (Postfix) with ESMTP id EF6F08078F; Thu, 5 Aug 2010 18:09:32 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1081)
Content-Type: text/plain; charset="us-ascii"
From: "Roy T. Fielding" <fielding@gbiv.com>
In-Reply-To: <20100806004907.GF27827@shareable.org>
Date: Thu, 05 Aug 2010 18:09:34 -0700
Content-Transfer-Encoding: 7bit
Message-Id: <C0FC87B7-C51C-4B36-BC16-DBDB0B00A20F@gbiv.com>
References: <Pine.LNX.4.64.1008051758290.5947@ps20323.dreamhostps.com> <AANLkTik0kbh14s2JZARY2MFh0iNGV7H+B4Px4yG+wX44@mail.gmail.com> <71BCE4BF-D3F6-4F94-BE76-306BDF6A2E67@apple.com> <Pine.LNX.4.64.1008051930160.5947@ps20323.dreamhostps.com> <4C5B1695.6070704@gmx.de> <F8E2F702-9F74-4316-B3B2-D5A731409ABF@apple.com> <4C5B2029.90403@gmx.de> <AANLkTim1WeCRfcPxXUNQcVhb4+t_TtDQDv2bXaxOQ=bk@mail.gmail.com> <01098AD0-FBF4-4A61-B565-947C95722BAA@apple.com> <AANLkTi=qQSND5BvUP5+P=wJ7E8SG6NncGZH8U8+VYwZ0@mail.gmail.com> <20100806004907.GF27827@shareable.org>
To: Jamie Lokier <jamie@shareable.org>
X-Mailer: Apple Mail (2.1081)
Cc: "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] Background info: Properties of sendfile()
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 06 Aug 2010 01:09:04 -0000

On Aug 5, 2010, at 5:49 PM, Jamie Lokier wrote:

> It's time to explain sendfile() better.
> 
> 0. Nearly all OSes used for web serving have something called
>   sendfile() or under a different name.  It has become a standard
>   method used in high performance static servers, and is beginning to
>   be used in dynamic servers that do smart caching.  It is given an
>   open file handle and range, and writes content of that file to a
>   TCP socket as efficiently as possible.  Some OSes allow contents of
>   process memory to be sent as well.

Unfortunately, you should also be aware that nearly all OSes have
severe kernel bugs in their implementations of sendfile and seem
to be getting progressively worse over time, to the point where
Apache httpd needs to disable it by default.  I don't know why.

....Roy