magro / memcached-session-manager

A tomcat session manager that backups sessions in memcached and pulls them from there if asked for unknown sessions
Apache License 2.0
759 stars 348 forks source link

Memcached-session-Manager Node Failover issue #291

Open RajuAyyappan opened 8 years ago

RajuAyyappan commented 8 years ago

_@magro _

We have recently integrated MemcachedBackupSessionManager with our application for storing sessions in couchbase inmemory db.

We are facing issues during Couchbase Node Failover. We have configured three couchbase nodes and clustered them together with a replica factor of 2. Every thing works fine if all nodes in the cluster are active.

But When one of the couchbase node in the cluster goes down. Our web application waits for around 3 minutes to continue with the same session from the next active nodes in the cluster some times application gets timed out unable to get the sessions from the other active nodes from cluster.

I can explain the scenario in detail. For example when a user logs in to a shopping site and adds some products in the cart and if one node in the cluster goes down during checkout. the applications keeps waiting for around 3 to 5 minutes to get the sessions from the other active nodes in the couchbase cluster. some times web application is not able to get the sessions even after 5 minutes and gets timed out. In this case the user needs to login again and add the products to the cart

Will Couchbase handle automatic session failover when one node goes down?

Context XML config:

<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
    memcachedNodes="http://192.168.91.71:8091/pools,http://192.168.91.75:8091/pools,http://192.168.91.110:8091/pools"
    username="default"
    sessionBackupAsync="false"
    sticky="false"
    memcachedProtocol="binary"
    operationTimeout="8000" 
    sessionBackupTimeout="8000"
    lockingMode="auto"   
    requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$" 
    transcoderFactoryClass="de.javakaffee.web.msm.JavaSerializationTranscoderFactory"
    />

Is there anything i have missed out in my configuration for handling session fail over

Requesting your support at the earliest

magro commented 8 years ago

Couchbase should handle the case when one node goes down. But I've never used couchbase on my own, therefore I can't help you much here. You should write a low level test that uses the couchbase client, writes and reads data to/from couchbase to see if this is a couchbase issue. If that's working, we can talk about msm again...