GithubHelp home page GithubHelp logo

Comments (9)

ran-jit avatar ran-jit commented on May 18, 2024

Hi @babujoym,

If the Redis server is down, session handler throw the exception. So you're getting the 500 - Internal server error for all the requests.

Reason:
This manager is designed for the distributed environment.

First level (request reached to tomcat server) all the request session values are updated from redis to request session context (redis stored values are the updated session values). So redis-server is down, requests will not be forwarded to the next level.

Thanks!

from tomcat-cluster-redis-session-manager.

posondlq avatar posondlq commented on May 18, 2024

If nginx has done session preservation, can redis be crossed ,but the application run properly, so that session sharing does not affect the whole application? Because ,sometimes session sharing is used to ensure serial upgrades, and front-end WEB applications are not affected.

from tomcat-cluster-redis-session-manager.

babujoym avatar babujoym commented on May 18, 2024

Yes I can see that the manager is designed for distributed environment and yes it doesn't make much sense to get data from normal local session as the requests can come to any of the distributed tomcats and fail.

What do you think about as a backup provide tomcat session replication, but i heard it takes a long time and not efficeant.

from tomcat-cluster-redis-session-manager.

ran-jit avatar ran-jit commented on May 18, 2024

Yep, tomcat session replication is not performant/efficient and cloud (VPC) environment (ex: AWS, GCP) they will not allow to share the data through network.

Secondly tomcat session replication internally uses File store or JDBC store. Reading data from File/Database will take time compare to redis (in-memory data store).

Issues I've faced with tomcat session replication:

  1. We've to enable sticky session (JSESSIONID) in your load balancer configuration. In this case, one of your tomcat node is down, LB takes time to forward the request to next tomcat node. Sometimes end users ll end up with blank page because of request timeout in internet fluctuation.
  2. Sometimes file store throw Files not responding/Files not open issue.

from tomcat-cluster-redis-session-manager.

ran-jit avatar ran-jit commented on May 18, 2024

Closing this issue. Please feel free to re-open this or create new issues in future.

Thanks!

from tomcat-cluster-redis-session-manager.

posondlq avatar posondlq commented on May 18, 2024

In the current way, if redis is crossed, applications can not be accessed. Once this happens, if we can not resume redis cluster in a short time, we can only cancel session sharing first, and i verify it is feasible. So it is still possible to support some configuration. When the LB support sticky session ,When redis cluster is across, applications can continue to run.

from tomcat-cluster-redis-session-manager.

ran-jit avatar ran-jit commented on May 18, 2024

@posondlq,

Yep, we can..

Redis-cluster has minimum of 3 nodes in the cluster group. If all 3 nodes are down then you will not get session related data from the redis cache. Also if all 3 nodes are down, then something you're missing in configuration/env.

I think if we implement that with feature flag, that will reduce the redis data read. I will look into the same and revert the updates soon.

Thanks!

from tomcat-cluster-redis-session-manager.

ran-jit avatar ran-jit commented on May 18, 2024

Hi @posondlq,

I've modified the changes and updated a pre-release (version: 3.0)

Please add 'lb.sticky-session.enabled' property in 'redis-data-cache.properties' configuration and enable this feature.

If enabled,

  1. Must be enabled sticky session in your load balancer configuration. Else this manager may not return the updated session values.
  2. Session values are stored in local jvm and redis.
  3. If redis is down/not responding, requests uses jvm stored session values to process user requests. Redis comes back the values will be synced.

I've tested in standalone redis env and don't have cluster env ready. If you've cluster enabled test env and time, please check..

Thanks!

from tomcat-cluster-redis-session-manager.

babujoym avatar babujoym commented on May 18, 2024

Thanks That's great.. Its a good addition

from tomcat-cluster-redis-session-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.