httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bp...@pacbell.net>
Subject RE: How to achieve zero-copy when reading request headers?
Date Mon, 01 Jul 2002 03:56:12 GMT
On Fri, 2002-06-28 at 19:01, Ryan Bloom wrote:
> > From: Brian Pane [mailto:bpane@pacbell.net]
> > 
> > One of the biggest remaining performance problems in the httpd is
> > the code that scans HTTP requests.  In the current implementation,
> > read_request_line() and ap_get_mime_headers() call ap_rgetline_core(),
> > which has to:
> >    - create a temporary brigade
> >    - call ap_get_brigade() to get the next line of input from the
> >      core input filter, which in turn has to scan for LF and split
> >      the bucket
> >    - copy the content into a buffer,
> >    - destroy the temp brigade
> >    - call itself recursively in the (rare) folding case
> > And all this happens for every line of the request header.
> 
> Have you looked at which of these are causing the most performance
> problems?

The creation and destruction of the temp brigade are most
time-consuming parts.  And the brigade creation and
destruction spend most of their time registering and
unregistering pool cleanup callbacks.

> It seems to me that the easiest thing to do, would be to use
> a persistent brigade, which removes two steps from this.

That definitely would help.  We'd have to put the persistent
brigade in the request_rec in order for ap_rgetline_core() to
find it.  I'll experiment with this approach and post a patch
if it works well.

--Brian



Mime
View raw message