php mcache feature suggestion -- weighted hashing

John McCaskey johnm at klir.com
Mon Feb 7 09:14:16 PST 2005


On Sun, 2005-02-06 at 12:51 -0800, xing at mac.com wrote:
> John,
> 
> While adding a 4th memcached server, it occurred to me this might be a 
> problem in the future.
> 
> Right now I have 3 memcached servers each with ~700MB. I want to add a 
> 4th with only 300MB of ram dedicated to memcache. Right now, the cache 
> are not saturated to the max so there is no bottleneck but in the 
> future, I could see premature cache flush in the smaller memcached 
> servers in an unbalanced memory setup.
> 
> I assume mcache currently does straight hashing? It would be nice to 
> have mecache poll each server's ram capacity, upon intial registration 
> call, and auto-weight the hashing based on the ram allocations per server.
> 

Yes, it does straight hashing.  This is handled by libmemcache.  As for
polling the capacity and weighthing the hashing, I agree it would be a
nice feature.  This is something however tha would need to be handled at
both the memcached protocol level (for polling of the memory capacity of
each server), and at the libmemcache level for supporting this. 

If that was done, then the php extension would automatically pick up the
support when linked against an updated libmemcache.  

I'm forwarding this on to the entire list for further discussion, since
it's not something I can handle in the php extension alone.

> Xing
> 
-- 
John A. McCaskey
Software Development Engineer
Klir Technologies, Inc.
johnm at klir.com
206.902.2027


More information about the memcached mailing list