how to tell when your cache is full?

Ben Hartshorne memcache at green.hartshorne.net
Fri May 25 20:24:35 UTC 2007


On Fri, May 25, 2007 at 02:40:26PM -0400, Gavin M. Roy wrote:
> Grab 1.2.2, it has an eviction value in the stats info.  An eviction is when
> memcache removes an expired item *or* the oldest non-used item to make room
> for a new item being added.

I think this would still be difficult to identify when the cache became
full.  The largest (kb) and most active records we've got have an
expiration time of 5min.  A large traffic spike would cause the cache to
fill, but 5 minutes later, we would see a large spike in evictions as
well.  However, if the traffic spike and the evictions came at the same
time, it would indicate the cache was full.

However, the overall volume of traffic is large enough that it could
conceal a spike in a particular section of the site, and the
corresponding spike in evictions wouldn't necessarily mean that the
cache had overflowed...  

So while I appreciate the metric, I'd *really* appreciate exposing it as
two separate metrics, and allow those who want just one to combine them
in their reporting.  That way, you can ignore expired items and only
watch the removal of the oldest non-used item rate to indicate how full
the cache has become.  

But why not just do this the obvious way - report how much space is
still available, taking into account expired items as well as unused
space?

-ben

-- 
Ben Hartshorne
email: ben at hartshorne.net
http://ben.hartshorne.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.danga.com/pipermail/memcached/attachments/20070525/560518f2/attachment.pgp


More information about the memcached mailing list