httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: brigade cleanup (was: Re: Finally found the problems. :-()
Date Sun, 31 Dec 2000 23:51:37 GMT

> Ah. My mistake... I thought brigade structures were malloc'd. If they're
> from a pool, then we have problems (see below). Also, presuming that we make
> them mallocs, then we need to be proactive (see below).

We cannot malloc() these.  There is too big a chance that we will miss
cleaning them up.  These really have to be palloc's.  As far as how many
we allocate, this is currently a problem, but not an unsolvable one.  I
knopw that Tony and others (I think Victor from IBM or Bill) have been
working on making ap_r* functions buffer their data, so that we don't use
as many brigades.  We could also modify some of the code slightly, so that
we used one brigade per filter + 1 (the handler).  This is all possible
within our current framework, without upsetting things too much.

> On Sun, Dec 31, 2000 at 03:21:43PM -0800, wrote:
> >...
> > We should not be trying to outsmart our allocation system.  Brigades are
> > incredibly small, specifically so that they can be allocated and just left
> > for the pools to deal with.  We are literally taking about a total of
> > three pointers.
> Three pointers multiplied by the content-size of the response is too big.
> Heck, one byte in proportion to the content-size is too big.

If we are using a brigade per byte, then we have big problems.  This is
one of the reasons that I dislike the ap_r* functions.  Basically, any
handler that uses those functions will be very sub-optimal.  We can work
on improving that, but we shouldn't try to optimize for those
handlers.  We should optimize for handlers that create their own
brigades, which is what we currently do.

> In summary:
> 1) don't use pool allocations for brigade structures. Use malloc and a
>    tricky cleanup (we can't use a dumb cleanup because then we're doing a
>    pool-alloc (for the cleanup info) for every brigade creation again).

I disagree, and this was discussed at the filter meeting, and everybody
agreed that using pools for the brigade was the correct thing to do.

> 2) call ap_brigade_destroy() when we're done with a brigade


Ryan Bloom               
406 29th St.
San Francisco, CA 94131

View raw message