spy with distributed caching

75 views
Skip to first unread message

Tharique Shameem

unread,
Jul 9, 2013, 5:33:01 AM7/9/13
to spymem...@googlegroups.com
Hi, I am working on a memcached setup with multiple nodes, and i wanted to clarify the following


1. What happens when one node goes down. 
 this can happens in many ways and I found the response the spy-client to be different when
a. the jvm of the memcached server goes down
and 
 b. the machine which hosts the server goes down( or disconnected from the network)
Can anyone help clarify this?
2. Is it possible to add nodes dynamically , during runtime, 
if yes , can u point me in the right direction on how to achieve this?
  
          

 
 
 

Matt Ingenthron

unread,
Jul 9, 2013, 7:30:39 PM7/9/13
to spymem...@googlegroups.com
On Jul 9, 2013, at 2:33 AM, Tharique Shameem <shameem....@gmail.com> wrote:

Hi, I am working on a memcached setup with multiple nodes, and i wanted to clarify the following


1. What happens when one node goes down. 
 this can happens in many ways and I found the response the spy-client to be different when
a. the jvm of the memcached server goes down
and 
 b. the machine which hosts the server goes down( or disconnected from the network)
Can anyone help clarify this?


I'm not sure I understand this question, as the canonical memcached server isn't a JVM.  Did you mean virtual machine by chance?

I can say that "down" can materialize in different ways and the client is designed so they are all eventually handled the same way.  In one case, where the TCP connection is reset, it will automatically try to reestablish the connection in background until the server comes back online.  In another case, where it just "goes away" a heuristic on receiving a number of continuous timeouts for a given node will eventually force the client to reset that connection, and then handle it approximately the same way.


2. Is it possible to add nodes dynamically , during runtime, 
if yes , can u point me in the right direction on how to achieve this?

There is no feature for this directly in spymemcached today.  I'd recommend using an AtomicReference and constructing new client objects as needed.

If you look deeper into the code, you will find evidence of reconfiguration, but this is primarily used by the Couchbase extensions to this client.  FWIW, that's also Open Source and may give you the dynamic adjustment you seek automatically.

Good luck,

Matt

Reply all
Reply to author
Forward
0 new messages