cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <>
Subject Re: [RT] Adaptive Caching
Date Thu, 17 Jul 2003 17:48:36 GMT
Berin Loritsch wrote:

> The concept translates over to the adaptive cache approach at almost 1:1.
> The actual individual cost sample is not important.  It is the windowed 
> average
> that is important.  For our cache a simple mean would best suit our problem
> space.  The size of the window for our samples will control how responsive
> our cache control algorithm is.  This would affect your cache prediction
> algorithm as the value k is no longer needed to control responsiveness. The
> value k can be set at 0, 1, or 0.5 depending on how you want to affect the
> slope.  IMO, the window size should be the determining factor at how the 
> average
> cost for a resource will converge toward the optimal point.  Large 
> window sizes
> provide slower response, while a smaller window provides faster response.

BTW.  If we use "0" for the value of "k", then the cache prediction algorithm
as is defined by your "discriminate caching" sequence would be a purely
random result.  The c(eff) function would solve down to the constant 0.5,
and since we discriminate based on a randomly generated number being less
than the result of the function, we have a 50/50 chance (theoretically) that
the random number would be greater than 0.5.  I say theoretcially because
not all random number generators are truly random, or even mostly random.

If we use "1" for the value of "k", then the prediction algorithm follows
the efficiency value much better.  There is a higher chance of having a
higher number for the cache prediction, which means we will be evaluating
more entries.  In fact, as the value for "eff" reaches +/-38, we will always
be caching because the result of the equation will always be 1.

If we use "0.5" for the value of "k", then the prediction algorithm still
follows the efficiency value, but our range is now to +/-76.  The question
then is, where statistically will this efficiency algorithm be all the time?

>> I'm thinking about implementing the cache separately from cocoon to 
>> see if the math behind it works or not. If you have code to share, 
>> that would be wonderful (you can place it in the scratchpad if you want)
> Ok.  Let me package this later today.  I have a meeting for the next 3 
> hours.


"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin

View raw message