Multiple caches in memcached?

Steven Grimm sgrimm at facebook.com
Wed Aug 2 09:25:15 UTC 2006


FYI, there is no command in memcached to list all the keys in the cache, 
so whether you use one cache or two you are going to need a different 
strategy.

There is a command intended for debugging that will list keys, but it 
has a hard limit on the size of the list and will only list keys up to 
that limit, even if there are more in the cache. And you don't want to 
use it frequently because it will make your cache unresponsive while it 
composes its output. (Like I said, it's intended for debugging of 
memcached internals, where that's not an issue.)

This comes up on the mailing list a lot -- read the archive for just 
about any month and you will find a discussion of why memcached doesn't 
support a "list keys" operation.

-Steve


Abhishek Pokharna wrote:
> - I do not want to iterate each and every key and there then decide 
> whether its a user or a group .I could have so many users or group 
> entries.The thing here is that I dont have the keys i need to 
> iterate.I would want to iterate on every User entity or group entity
> Suppose I have 1000 users and 2000 groups in one cache,and if i just 
> needed all the 1000 users, I would unnessary iterate 3000 keys.
>  
> Thanks
> Abhishek



More information about the memcached mailing list