Regarding Consistent Hashing....

Ajinkya Nahar ajinkya at truesparrow.com
Thu Aug 30 09:29:00 UTC 2007


Hi,

I am using PHP.
Is PECL/PHP client from cvs repository or libketama better for consistent
hashing?
Please let me know.
-----Original Message-----
From: dormando [mailto:dormando at rydia.net] 
Sent: Thursday, August 30, 2007 2:14 PM
To: Ajinkya Nahar
Cc: memcached at lists.danga.com; sunil at truesparrow.com; 'Nishith Shah'
Subject: Re: Regarding Consistent Hashing....

Ajinkya Nahar wrote:
> Hi,
> 
>  
> 
> Basically, we are using Amazon's EC2 servers as memcached servers.
> 
>  
> 
> So as and when we see an increase in traffic/load, we expect to add more 
> EC2 servers to the memcached cloud. And when the traffic/load subsides 
> (lets say after a week or so), we might remove a few servers from the 
> cloud.
> 
>  
> 
> In such a scenario, if using normal hashing, I believe we would have to 
> flush everything when adding/removing memcached servers.
> 
>  
> 
> Do you think doing this might cause the system to go in a spin and might 
> be a risky proposition, and so we should rather consider using 
> consistent hashing?
> 
>  
> 
> Or do you think this is not a big deal and we should rather use the 
> regular hashing (which is more stable)?
> 
>  
> 
> Please let me know your comments on this.
> 
>  
> 
> Regards,
> 
> Ajinkya

Are your application servers local to EC2 as well? If not, I can't 
imagine the latency being any good for the system, and it'd have to be 
over fat CPU intensive encrypted links. Memcached's not very CPU heavy, 
so I don't really see it being that great of a use for EC2. It thrives 
on fast local links with massive gobs of RAM.

Just use consistent hashing if you're worried. There should be enough 
libraries to work, or you can test the pecl client, or use libketama if 
you use php. Hard to go wrong with it.

-Dormando



More information about the memcached mailing list