Joe Orton wrote:
> On Wed, Oct 25, 2006 at 01:44:48PM -0000, Graham Leggett wrote:
>> Author: minfrin
>> Date: Wed Oct 25 06:44:47 2006
>> New Revision: 467655
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=467655
>> Log:
>> mod_cache: Fix an out of memory condition that occurs when the
>> cache tries to save huge files (greater than RAM). Buckets bigger
>> than a tuneable threshold are split into smaller buckets before
>> being passed to mod_disk_cache, etc. PR 39380
> 
> Another couple of hundred lines of code and even a new config directive, 
> and this still doesn't get close to actually fixing the problem! -1 
> already, this code is just not getting better.  mod_disk_cache is still 
> liable to eat all your RAM in that apr_bucket_read() loop, the 
> apr_bucket_split() is not guaranteed to work for a morphing bucket type.
> 
> It is simple enough to fix this problem without adding all this code and 
> without all the stuff in r450105 too, something like the below.
> 

And you almost got it right. We don't want to stop caching if the
client's connection fail and we must not slow the caching because of a
slow client (that's why I didn't pass the brigade).

In the end, your's do almost the same as mine [1] expect that I dint's
pass the new buckets up the chain before deleting then (and it was file
bucket exclusive). Copying to disk tends to be faster then sending to a
client.

--
Davi Arnaut

1 http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=115971884005419&w=2

Reply via email to