timeoutExceptionThreshold is set to 30 secs and yet failover takes 3 mins.

230 views
Skip to first unread message

Rajeev Warrier

unread,
Jul 5, 2017, 5:23:20 PM7/5/17
to spymemcached
We have memcached setup on two nodes. We wanted to test the failover time when one memcached node goes down. The expectation was that the failover would happen in 30 secs if timeoutExceptionThreshold is set to 30 secs. timeoutExceptionThreshold is the only value which we are explcitly setting through application. This essentially means that the other values are the default values mentioned in DefaultConnectionFactory. 

Though the timeoutExceptionThreshold value was set to 30 secs, failover happened only 2 - 3 minutes. Till that point following exception was thrown :

net.spy.memcached.OperationTimeoutException: Timeout waiting for value
        at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1185) ~[spymemcached-2.7.3.jar:]
        at net.spy.memcached.MemcachedClient.get(MemcachedClient.java:1200) ~[spymemcached-2.7.3.jar:]

After 2 -3 mins the error disappears. The exception happens while doing an asyncGet. After around 3 mins the error disappers and the failover happens.

Can somebody throw more light on the behavior. And also, can someone point me to the piece of logic in "spymemcached code" which results in the above exception.

We are using spymemcahed-2.7.jar as the client. 
memcached-1.4.4-5 is the memcached server  being used.

Any help would be highly appreciated.

Thanks,
Rajeev

Matt Ingenthron

unread,
Jul 5, 2017, 5:28:13 PM7/5/17
to spymemcached
What do you mean by "failover time" in this context?  Are you using the ketama node locator?

Generally speaking, the client will keep trying to complete the operation you're asking it to do until the timeout value.  If the node it has located is gone, it'll continue to timeout since it can't build the connection.

For new operations, node location would then switch to an alternate node for that hash value.

--
You received this message because you are subscribed to the Google Groups "spymemcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spymemcached...@googlegroups.com.
To post to this group, send email to spymem...@googlegroups.com.
Visit this group at https://groups.google.com/group/spymemcached.
For more options, visit https://groups.google.com/d/optout.

emon....@rockyou.com

unread,
Aug 3, 2017, 2:01:07 AM8/3/17
to spymemcached
TimeOutThreshHoldException is to tell client (spymemcached) how many operations fail before it tries to reconnect and its not seconds not for what you expected above. What you want to set is MaxReconnectDelay.
Reply all
Reply to author
Forward
0 new messages