meaning of memcached cluster
Hello!
I just installed the Membase memcached server on two windows boxes.
I have a client using NHIbernate, and I would like to use memcached as my second
level cache.
In my NHibernate config file, I have entered the IPs for the two servers. Also, according
to the standard memcached docs, memcached servers are disconnected and know nothing about each other; it is up to the client to store and retrieve from the right server.
So, how does the Membase concept of cluster figure into all this? Does clustering or not clustering affect how the the cache is used? Do clustered servers talk to each other? Or is it purely for management purposes that servers are clustered.
Thanks!
Aaron
Thanks, Perry. Very interesting. My NHibernate client does not support consistent hashing at the moment, so the proxy solution looks interesting. But, I need to have high availability, so
if the proxy failed, then I would lose the entire cluster.
Aaron, each and every server runs an instance of the proxy. For HA, you would simply point your clients at multiple servers (though it need not be all) and that way if one died, you would have the others still available to handle requests. Does that make sense?
Perry
Thanks, Perry.
In a previous post, you said, regarding the proxy port:
" This allows non-smart clients to not require all IP addresses to be in their configuration and thus prevent some of the problems associated with rehashing when adding/removing server."
My situation is: I have a non-smart client, and I need high availability. Suppose I have two memcached servers, IP1 and IP2, in a cluster. Are you saying that I could point my client to IP1:11212 and get access to both servers in the cluster? If so, then this would not provide HA, in case IP1 goes down.
I suppose, for HA, I could have two clusters, one clustered to IP1 and one clustered to IP2, and point my client to both IP1:11212 and IP2:11212, and then add and remove servers on the two clusters without updating my client configuration.
Currently, my memcached client doesn't support consistent hashing, but I am hoping to use the enyim client by the time we release, and this does support consistent hashing. But this proxy feature would still be useful.
Thanks again,
Aaron
Aaron, for your initial setup, you should be able to point your client at both IP1 and IP2 (while clustered together) on port 11212. As you add servers, the clients will have access to that data without worrying about hashing issues. In this case, the servers at IP1 and IP2 would handle all of the traffic for the whole cluster (potentially creating a bottleneck if the load is very high). As you grow, you could reconfigure your client to add more and more servers to distribute the load more evenly.
I would highly recommend implementing the Enyim client since it allows you to connect to the REST interface of our cluster and automatically update itself for any cluster topology changes. You would still want to point it at at least 2 IP's for HA, but instead of those two IP's being a potential bottleneck, the client will distribute load to all the servers in the cluster and talk to them directly without a proxy (which will provide better performance).
Does that all make sense?
Thanks Aaron.
Perry
Yes, that does makes sense.
Thanks very much for the detailed explanation.
Hi Aaron, thanks for your inquiry. By default, the clustering within NorthScale's server doesn't have anything to do with your use of the cache. Each server will run and respond to requests independently (if accessed through port 11211).
Our clustering comes into play in a few areas:
-Management/statistics: You can create buckets, and view the statistics for the whole cluster as an aggregate
-"Smart clients": There are currently 2 clients (Enyim for C#/.Net and our wrapper to spymemcached for Java) that allows you to point your clients at the REST API of our cluster. They will automatically receive any cluster topology changes and update their configuration dynamically.
-When using the proxy port: Port 11212 is running a proxy which basically allows you to access any piece of data within the cluster from any node. This allows non-smart clients to not require all IP addresses to be in their configuration and thus prevent some of the problems associated with rehashing when adding/removing server.
Hope that helps Aaron, let me know if there's anything else I can answer for you.
Perry
Note that this discussion changes dramatically for our Membase product, but I've tailored my responses for Memcached.
Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Membase: http://www.membase.com/products-and-services/overview
Call or email "sales -at- membase -dot- com" today!