httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <brian.p...@cnet.com>
Subject Re: mod_cache CacheMaxStreamingBuffer
Date Thu, 12 Dec 2002 16:25:14 GMT
On Thu, 2002-12-12 at 07:53, Bill Stoddard wrote:
> The CacheMaxStreamingBuffer function is currently implemented in mod_cache. It
> carves out a chunk of RAM to buffer responses, regardless of the actual storage
> manager (mod_mem_cache or mod_disk_cache) that will ultimately be used cache the
> response. The function is not really useful if you are using mod_disk_cache.
> 
> IMHO, the streaming buffer function belongs in the storage manager
> (mod_mem_cache) rather than mod_cache.  I propose we move this function into
> mod_mem_cache.  I also question the need for the CacheMaxStreamingBuffer
> configuration directive. Why not use MCacheMaxObjectSize as the max streaming
> buffer size?  This would eliminate a source of misconfiguration, and
> specifically the case of neglecting to include CacheMaxStreamingBuffer in
> httpd.conf (I spent maybe 30 minutes trying to figure out why some responses
> were not being cached that I knew darn well were within my configured cache size
> thresholds. Most Apache users would not have a clue where to start looking for
> the cause, nor should they be expected to have a clue).
> 
> I'll start working on this if I hear no objections.

When I added CacheMaxStreamingBuffer originally, I had two
reasons for making it a separate directive:

  1. As a separate directive, it could be disabled by default
     to guarantee that the new functionality wouldn't break
     anyone's existing mod_cache setup.
        [I'm no longer worried about this issue, now that
        the code has been in place for a while.]

  2. There are some extreme cases where the maximum cacheable
     object size could be too large a value for CacheMaxStreamingBuffer.
     For example, if MCacheMaxObjectSize is 20MB, and your server
     is servering a mix of 10MB static files and 30MB streamed
     CGI responses with no content-length information, then each
     CGI response will cause mod_cache to buffer 20MB of content
     before giving up and freeing all that space.
        [I am still worried about this issue.]

I suppose we could eliminate my second concern by simply adding
a note to the documentation that says, "don't use ridiculously
large values for MCacheMaxObjectSize."  What do you think?

If you move the stream buffering to the storage manager, does
that mean that mod_disk_cache won't be able to cache streamed
responses any more?  Or are you thinking of mirroring the current
buffering logic with something that stores the pending content
in the file rather than in-core?

Brian



Mime
View raw message