httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject Re: CGI single-byte reads Re: 2.0.30-dev load spiking [was: upgrade to FreeBSD 4.5-PRERELEASE]
Date Thu, 24 Jan 2002 05:41:56 GMT

> > On Fri, Jan 04, 2002 at 11:39:27PM -0800, Brian Pane wrote:
> > > 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.
> >
> > I've just committed a note about this in STATUS. I think converting
> > it to take a brigade is the way to go.
> >
> > -aaron
> >
> 
> ap_scan_script_header_err calls apr_file_gets(buf, len, (apr_file_t *) f) where len =
8191 bytes.
> 
> apr_file_gets reads one byte at a time, even if it has a large buffer available to it.
 What's up
> with that? Looks like apr_file_gets is wonky.
> 
> Bill
> 

Ahh... I grok it now.  apr_file_gets is behaving like gets, as it should.  Brigades it is...

Bill


Mime
View raw message