Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 24259 invoked from network); 26 Oct 2006 07:17:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2006 07:17:36 -0000 Received: (qmail 54725 invoked by uid 500); 25 Oct 2006 16:54:43 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 54648 invoked by uid 500); 25 Oct 2006 16:54:42 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 54630 invoked by uid 99); 25 Oct 2006 16:54:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Oct 2006 09:54:42 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [65.99.219.155] (HELO haxent.com) (65.99.219.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Oct 2006 09:54:28 -0700 Received: from [192.168.1.101] (unknown [189.2.38.218]) by haxent.com (Postfix) with ESMTP id BFD7E3096B for ; Wed, 25 Oct 2006 13:54:05 -0300 (BRT) Message-ID: <453F96AC.6030705@haxent.com.br> Date: Wed, 25 Oct 2006 13:54:04 -0300 From: Davi Arnaut MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: svn commit: r467655 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_cache.xml modules/cache/mod_cache.c modules/cache/mod_cache.h References: <20061025134448.A00131A9846@eris.apache.org> <20061025155843.GD29589@redhat.com> In-Reply-To: <20061025155843.GD29589@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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