Multiple caches in memcached?

Abhishek Pokharna pokharnaabhishek at
Wed Aug 2 09:19:22 UTC 2006

- 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.

Steven Grimm <sgrimm at> wrote:
  You can indeed set up two memcached instances on different ports. You 
will have to make sure their combined maximum memory usage fits in your 
machine's physical memory, and you will have to manually decide what 
percentage of that memory goes to each cache (by setting the respective 
memcached instances' maximum memory options to appropriate values). But 
it should work fine. We run multiple memcached instances on a few of our 
computers to take advantage of multiple CPUs with no issues.

But help me understand: why can you iterate through keys 1, 2, 3, 4, 
etc., but not keys u1, u2, u3, u4, etc.? I am having a hard time coming 
up with a scenario where that would involve more than stripping off or 
prepending a character as you do exactly the same iteration you would do 
without the prefixes. It is quite possible I simply don't understand 
what you're trying to achieve, though.


Abhishek Pokharna wrote:
> Thats what i dont want to do. There are situations where I dont know 
> the keys and I need to performe some "global" operation on each type 
> of cache,like iterating all users or groups and do something with each 
> entity.
> Could I possibly start another daemon thread on a separate port which 
> will imitate another type of cache? But would this be expensive on 
> resources?
> Thanks
> Abhishek

 Here’s a new way to find what you're looking for - Yahoo! Answers 
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the memcached mailing list