You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Paul Querna <ch...@force-elite.com> on 2006/10/24 09:31:06 UTC

Re: mod_disk_cache summarization

Graham Leggett wrote:
> Davi Arnaut wrote:
> 
>> Have you seen my patch to address this issue ? IMHO, it is far less
>> complex and less expensive then the committed workaround.
> 
> No - I went through your patches in some detail, but I didn't see one 
> that addressed this problem specifically. Once thundering herd is 
> solved, I plan to commit all your refactoring patches.
> 
>> I didn't like that sleep/fstat hackery. How about using a real file
>> notification scheme ?
> 
> The prerequisite is that APR needs to be taught about this scheme, and 
> it has to work portably across all platforms.

No it doesn't.  mod_disk_cache makes many assumptions about the 
underlying OS, like how moving a file on the same file system is atomic, 
and how you can move files that have open file descriptors, both of 
which aren't true with some file systems or operating systems (like uh.. 
windows).

mod_disk_cache is a high performance part, lets make it work great on 
most unixy/POSIX type platforms, and come back to making it portable later.

-Paul

Re: mod_disk_cache in trunk, was Re: mod_disk_cache summarization

Posted by Graham Leggett <mi...@sharp.fm>.
On Tue, October 24, 2006 7:05 pm, Paul Querna wrote:

> Well, yes, you are right, I finally had time to read some of the changes
> in trunk, and r450105 is freaking crazy:
> http://svn.apache.org/viewvc?view=rev&revision=450105
>
> It replaced a cheap atomic operation, with copying the entire file off
> disk in chunks.  How could that ever make sense?

Previous behaviour was to load the entire bucket - all 4.7GB of it - into
RAM, and then attempted to write it to disk, which never happened because
the process had aborted at this point with an out of memory condition.

I fail to see how the previous behaviour could make sense, but there you go.

The current behaviour is also wrong, because mod_disk_cache should know
nothing about buckets whatsoever. This will be moved into an output filter
capable of writing to a file.

> The final MOVE of the temp file to the cache file should of had NOTHING
> to do with making it safe for large files.  It seems the patch (and
> CHANGES entry) did way more than what was described.

I don't see anything in that particular patch that did the removal of the
temp files. I looked at lots of patches trying to combine Davi's and
Niklas' work, so I don't remember at this point which did.

>> mod_disk_cache needs to be high performance yes, but not to the point
>> where that means it's broken on half the platforms.
>
> If it works on FreeBSD, Linux, and Solaris on Fridays, its good enough
> for me.

If it results in people going to the effort of rewriting what is there now
rather than using it, then it's not good enough for me.

Regards,
Graham
--



mod_disk_cache in trunk, was Re: mod_disk_cache summarization

Posted by Paul Querna <ch...@force-elite.com>.
Graham Leggett wrote:
> On Tue, October 24, 2006 9:31 am, Paul Querna wrote:
> 
>>> The prerequisite is that APR needs to be taught about this scheme, and
>>> it has to work portably across all platforms.
>> No it doesn't.  mod_disk_cache makes many assumptions about the
>> underlying OS, like how moving a file on the same file system is atomic,
>> and how you can move files that have open file descriptors, both of
>> which aren't true with some file systems or operating systems (like uh..
>> windows).
> 
> As I understand, there is no more file moving inside mod_disk_cache, so
> this is no longer true.

Well, yes, you are right, I finally had time to read some of the changes 
in trunk, and r450105 is freaking crazy:
http://svn.apache.org/viewvc?view=rev&revision=450105

It replaced a cheap atomic operation, with copying the entire file off 
disk in chunks.  How could that ever make sense?

The final MOVE of the temp file to the cache file should of had NOTHING 
to do with making it safe for large files.  It seems the patch (and 
CHANGES entry) did way more than what was described.

>> mod_disk_cache is a high performance part, lets make it work great on
>> most unixy/POSIX type platforms, and come back to making it portable
>> later.
> 
> I'd rather not do a whole lot of work coming up with a works-for-me cache,
> and then have to field a whole lot of bug reports (like, say from Windows
> users ;) ) and then have to fix all the problems that come up by rewriting
> everything again.
> 
> mod_disk_cache needs to be high performance yes, but not to the point
> where that means it's broken on half the platforms.

If it works on FreeBSD, Linux, and Solaris on Fridays, its good enough 
for me.

-Paul

Re: mod_disk_cache summarization

Posted by Graham Leggett <mi...@sharp.fm>.
On Tue, October 24, 2006 9:31 am, Paul Querna wrote:

>> The prerequisite is that APR needs to be taught about this scheme, and
>> it has to work portably across all platforms.
>
> No it doesn't.  mod_disk_cache makes many assumptions about the
> underlying OS, like how moving a file on the same file system is atomic,
> and how you can move files that have open file descriptors, both of
> which aren't true with some file systems or operating systems (like uh..
> windows).

As I understand, there is no more file moving inside mod_disk_cache, so
this is no longer true.

> mod_disk_cache is a high performance part, lets make it work great on
> most unixy/POSIX type platforms, and come back to making it portable
> later.

I'd rather not do a whole lot of work coming up with a works-for-me cache,
and then have to field a whole lot of bug reports (like, say from Windows
users ;) ) and then have to fix all the problems that come up by rewriting
everything again.

mod_disk_cache needs to be high performance yes, but not to the point
where that means it's broken on half the platforms.

Regards,
Graham
--