httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject AP_MIN_SENDFILE_BYTES
Date Wed, 31 Jan 2001 22:51:48 GMT

Ryan recently committed a patch to disable sendfile if the number of bytes to
send was less than AP_MIN_SENDFILE_BYTES.  Had a couple of private notes
exchanges with Ryan and wanted to bring the discussion public. Here is an
example supporting the patch (from Ryan):

telnet localhost 80
GET /index.html HTTP/1.1
Host: localhost
Range: bytes= 0-850, 840-900

Without this change, this requires three calls to sendfile.  One for bytes
0-850, one for bytes 840-850, and one for 850-900.

The patch get around this nicely, however at a steep price on Apache for
Windows.  We take a 50% performance hit when serving files smaller than
AP_MIN_SENDFILE_BYTES because we cannot use apr_sendfile() and reuse the
accept socket.  I would like to consider alternate solutions such as:

1. back this patch out entirely and suffer the small packets on the network
for the cases above (which are not that common).

2. Ryan suggests tuning AP_MIN_SENDFILE_BYTES. To what?  500 bytes? The number
needs to be much smaller than 8192 where it is set now. Thoughts?

3. Bypassing this optimizationonly for byterange requests (or perhaps multiple
byterange requests)

Bill


Mime
View raw message