httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <brian.p...@cnet.com>
Subject CGI single-byte reads Re: 2.0.30-dev load spiking [was: upgrade to FreeBSD 4.5-PRERELEASE]
Date Sat, 05 Jan 2002 07:39:27 GMT
Aaron Bannert wrote:

>On Thu, Jan 03, 2002 at 11:56:26AM -0500, Greg Ames wrote:
>
>>I do see some weirdness in 2.0.30 with www.apache.org/dyn/closer.cgi -
>>it looks like we're doing one byte reads from the pipe to the cgi.  I
>>don't know yet if 2_0_28 does the same.  That's all I've spotted so far,
>>except for a couple of annoying extra syscalls that also exist in
>>2_0_28.
>>
>
>I don't think that would spike the run queue more than 1, no?
>
>Of course, one-byte reads from a cgi pipe are just plain bogus
>to begin with, but on a different scale methinks.
>

The one-byte reads are for the CGI's response header.  The problem is that
mod_cgi hands off the pipe (non-buffered) to ap_scan_script_header_err(),
which does single-byte reads until it finds the end of the header.  After
that, mod_cgi finally builds a pipe-bucket, which is buffered, so the 
reading
of the content happens in much larger chunks.

The easiest solution I can think of is to change ap_scan_script_header_err()
to accept a brigade rather than an apr_file_t, so that we can take advantage
of the pipe bucket's buffering when reading the headers.

Brian



Mime
View raw message