Cache data that whose size changes over time

Håkan Waara hakan.waara at travelocitynordic.com
Fri Feb 29 14:04:55 UTC 2008


Hello all,

I've read the FAQ and as much as I've found on the mailing list 
regarding this issue.

We're using memcached for our site, to cache all sorts of different 
data. It works pretty well.

The thing is, we don't have 100% control over the size of the data we 
typically cache. It may change over time. The problem then of course 
becomes that the slab classes are already populated, so things of other 
sizes won't find a slab class that matches their size, and thus cannot 
be cached at all.

One common suggestion seems to be to "warm up" the cache. Would it be a 
bad idea to warm up every slab class with a minimum of 1 item, just to 
make sure they're all "open"? I guess that is something we'd like to avoid.

Another way is to manually adjust the slab sizes over time, using 
memcached-tool to move items around, or even restarting the daemons. 
This seems a bit tedious though.

Is there any way to automatically adjust the slabs over time, as the 
data stored changes? What's the current practice for dealing with this 
problem, for other users of memcached?

Any advice appreciated - thanks!

-- 
Håkan Waara
Travelocity Nordic


More information about the memcached mailing list