On Thursday 12:08 PM 8/21/2008, Titi Alailima wrote:
It's perfectly acceptable in dealing with caching systems that the cached value could be out of sync, but not that the cached value could be for something entirely different from what you were looking for.

Yep. I think that aspect of the issue has been getting lost--it's not just about getting stale data from a given file, but getting data from an entirely *different* file, which I'd agree violates any reasonable expectation of a caching system.

So I think we need both fixes, one to eliminate caching unless a certain criterion of "static-ness" has been met, and the other to prevent the cache from returning completely unrelated data.

You make a good point. The fix I suggested is intended to make fastpath caching behave well in all cases where time proceeds monotonically (which I'd guess is by far the most common use case, especially for a web server that's unlikely to call utilities like tar/rsync that would munge file times). In fact that's essentially what I mean by "pathological". But to protect against the time-travelling scenarios causing fastpath to confuse two different files, you'd have to use the filename-as-key fix as well.

Using the filename as a key is a bummer for sites like AOL that want the cache to respect hard links when serving data from the cache, though. It won't matter for us either way, since we're not that concerned about the cache in the first place--just about the ways in which it might return the wrong data.

(In case anyone's wondering: Arena's web application pre-caches large amounts of data when it starts, and web servers aren't put into rotation until they've finished this pre-caching step. The web servers are also bathed in RAM, so it's unlikely that fastpath caching is offering much of a performance boost over the Linux page cache--especially when that time is set against the overhead of database access.)

- John


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to