IDEA: Hierarchy of caches for high performance AND high capacity.

Paul T pault12345 at
Wed Nov 1 19:40:39 UTC 2006

--- Peter Zaitsev <pz at> wrote:

> Paul T wrote:
> > The L1 / L2 caching view (memcached being L2 and
> local
> > cache being L1)

> > The key problem is that when L1 cache of web node
> A is
> > getting updated, the update *has* to be propagated
> to
> > L1 cache of web node B (C, D e t.c.) 
> Paul,
> In this case you assume certain cache policy, more
> exactly the one which
> needs cache invalidation.     

The only thing that I assume is that web node A should
return the results 100% identical to results returned
by web node B - hence if web node A begins to store
something locally the exact same 'something' has to be
propagated to web node B, no matter what that
'something' is.

> I would suggest using
> L1 cache for 
> something where you can relay  simply on expiration
> so you never need to 
> do anything complicated with it.

In any case you have to spend some effort on
synchronizing the L1 caches of several web nodes, to
keep the L1's identical (unless we drop the condition
of web nodes equivivalence)

> Now interesting enough there are some problems with
> write invalidation 
> with memcached as well.

That is fault tolerance / load balancing domain. 

Yes, there is no official memcached solution for this,
but that is only because official memcached cluster
architecture is missing controlling node among many
other things (such as grouping of keys e t.c.) That
will change eventually.


> Lets say you had 3 memcached nodes and one of them
> failed due to network 
> disconnect.  Now you can ether stop caching from
> this node which will 
> slow down things dramatically -  going from 5% miss
> rate to 35% miss 
> rate is very serious.  Or you can rehash  this node
> hash among other 
> nodes.  In this case you get all scope of standard
> problem of making 
> sure all memcached users reconfigure at the same
> time as well as  making 
> sure they do not pickup old box  after it is back as
> it has stale data.
> In many installations I've seen people simply tend
> not to think about it 
> and rely on luck of this not happening often :)
> -- 
> Peter Zaitsev,  MySQL Performance Expert
> MySQL Performance Blog -
> MySQL Consulting

Everyone is raving about the all-new Yahoo! Mail 

More information about the memcached mailing list