You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Pane <br...@apache.org> on 2002/08/16 09:34:11 UTC

[PATCH] zero-copy core_output_filter for keepalives

[Posting for comments before I commit, because the
core filter code is somewhat complex...]

With the current core_output_filter() implementation,
if the client requests a file smaller than 8KB, the
filter reads the file bucket, makes a copy of the
contents, and sets the copy aside in hopes of being
able to concatenate it with the next response.

This copying results in a performance penalty when
using keepalive requests for small files.

The attached patch removes the copy in the common case
where there's only one file bucket in the brigade being
set aside.  Instead of copying the file contents, the patch
just sets aside the file bucket as-is, so that the next
invocation of core_output_filter can call sendfile if there's
not another response immediately following this one.  (If
there are multiple file buckets in the brigade to be set
aside, though, this code turns all but the first of them
into mmap buckets to ensure that we can't run out of file
descriptors in extreme use cases.)

Brian


Re: [PATCH] zero-copy core_output_filter for keepalives

Posted by Justin Erenkrantz <je...@apache.org>.
On Fri, Aug 16, 2002 at 12:34:11AM -0700, Brian Pane wrote:
> [Posting for comments before I commit, because the
> core filter code is somewhat complex...]

Looks correct based on my examination.  +1.  -- justin