httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bri...@apache.org>
Subject [PATCH] zero-copy core_output_filter for keepalives
Date Fri, 16 Aug 2002 07:34:11 GMT
[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


Mime
View raw message